Get the default value of a variable I want to display the default value of a variable when no value is set. I checked the Drupal 8 documentation pages, but I couldn't find any information about the default value.

In Drupal 7 if variable value is not set then default value is displayed.
variable_get('variable_name', 'hello');

If &quot;variable_name&quot; is not set at that time, hello will be returned.

Now for Drupal 8 I am trying the following way.
$config = $this-&gt;configFactory-&gt;get('module_name.settings');

$config-&gt;get('variable_name', 'hello'),

I am not getting hello.
Your module ships with a default config; it gets installed. Now your config has the default value; if someone overrides it, it doesn't have one anymore. $config-&gt;get('foo') doesn't have a default value.