diff --git a/pyhocon/config_parser.py b/pyhocon/config_parser.py
index a3a2191..1c966d6 100644
--- a/pyhocon/config_parser.py
+++ b/pyhocon/config_parser.py
@@ -83,6 +83,16 @@ class ConfigFactory(object):
         """
         return ConfigParser().parse(content, basedir, resolve)
 
+    @staticmethod
+    def from_dict(dictionary):
+        """Convert dictionary (and ordered dictionary) into a ConfigTree
+        :param dictionary: dictionary to convert
+        :type dictionary: dict
+        :return: Config object
+        :type return: Config
+        """
+        return ConfigTree(dictionary)
+
 
 class ConfigParser(object):
     """
diff --git a/pyhocon/config_tree.py b/pyhocon/config_tree.py
index 92b98a0..a11433d 100644
--- a/pyhocon/config_tree.py
+++ b/pyhocon/config_tree.py
@@ -18,6 +18,7 @@ class ConfigTree(OrderedDict):
 
     def __init__(self, *args, **kwds):
         super(ConfigTree, self).__init__(*args, **kwds)
+
         for key, value in self.items():
             if isinstance(value, ConfigValues):
                 value.parent = self
diff --git a/pyhocon/tool.py b/pyhocon/tool.py
index 267a862..35010bd 100644
--- a/pyhocon/tool.py
+++ b/pyhocon/tool.py
@@ -9,6 +9,7 @@ LOG_FORMAT = '%(asctime)s %(levelname)s: %(message)s'
 
 
 class HOCONConverter(object):
+
     @staticmethod
     def to_json(config, indent=2, level=0):
         """Convert HOCON input into a JSON output

How to dump HOCON file?
Hi,

Just wonder how to do this with pyhocon?

https://marcinkubala.wordpress.com/2013/10/09/typesafe-config-hocon/

Thanks.
diff --git a/tests/test_config_parser.py b/tests/test_config_parser.py
index 16bd518..4c02aed 100644
--- a/tests/test_config_parser.py
+++ b/tests/test_config_parser.py
@@ -3,6 +3,10 @@ from pyparsing import ParseSyntaxException, ParseException
 import pytest
 from pyhocon import ConfigFactory, ConfigSubstitutionException
 from pyhocon.exceptions import ConfigMissingException, ConfigWrongTypeException
+try:  # pragma: no cover
+    from collections import OrderedDict
+except ImportError:  # pragma: no cover
+    from ordereddict import OrderedDict
 
 
 class TestConfigParser(object):
@@ -1143,3 +1147,22 @@ with-escaped-newline-escape-sequence: \"\"\"
         assert config['with-escaped-backslash'] == '\n\\\\\n'
         assert config['with-newline-escape-sequence'] == '\n\\n\n'
         assert config['with-escaped-newline-escape-sequence'] == '\n\\\\n\n'
+
+    def test_from_dict_with_dict(self):
+        d = {
+            'banana': 3,
+            'apple': 4,
+            'pear': 1,
+            'orange': 2,
+        }
+        config = ConfigFactory.from_dict(d)
+        assert config == d
+
+    def test_from_dict_with_ordered_dict(self):
+        d = OrderedDict()
+        d['banana'] = 3
+        d['apple'] = 4
+        d['pear'] = 1
+        d['orange'] = 2
+        config = ConfigFactory.from_dict(d)
+        assert config == d

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.9
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
exceptiongroup==1.2.2
iniconfig==2.1.0
packaging==24.2
pluggy==1.5.0
-e git+https://github.com/chimpler/pyhocon.git@cfe9a3c34f0fb5aabfa7f5257b573058be84e490#egg=pyhocon
pyparsing==2.0.3
pytest==8.3.5
tomli==2.2.1

name: pyhocon
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - exceptiongroup==1.2.2
      - iniconfig==2.1.0
      - packaging==24.2
      - pluggy==1.5.0
      - pyparsing==2.0.3
      - pytest==8.3.5
      - tomli==2.2.1
prefix: /opt/conda/envs/pyhocon

tests/test_config_parser.py::TestConfigParser::test_from_dict_with_dict tests/test_config_parser.py::TestConfigParser::test_from_dict_with_ordered_dict
tests/test_config_parser.py::TestConfigParser::test_parse_simple_value tests/test_config_parser.py::TestConfigParser::test_parse_with_enclosing_brace tests/test_config_parser.py::TestConfigParser::test_parse_with_enclosing_square_bracket tests/test_config_parser.py::TestConfigParser::test_quoted_key_with_dots tests/test_config_parser.py::TestConfigParser::test_comma_to_separate_expr tests/test_config_parser.py::TestConfigParser::test_dict_merge tests/test_config_parser.py::TestConfigParser::test_parse_with_comments tests/test_config_parser.py::TestConfigParser::test_missing_config tests/test_config_parser.py::TestConfigParser::test_parse_null tests/test_config_parser.py::TestConfigParser::test_parse_empty tests/test_config_parser.py::TestConfigParser::test_parse_override tests/test_config_parser.py::TestConfigParser::test_concat_dict tests/test_config_parser.py::TestConfigParser::test_concat_string tests/test_config_parser.py::TestConfigParser::test_concat_list tests/test_config_parser.py::TestConfigParser::test_bad_concat tests/test_config_parser.py::TestConfigParser::test_string_substitutions tests/test_config_parser.py::TestConfigParser::test_int_substitutions tests/test_config_parser.py::TestConfigParser::test_cascade_string_substitutions tests/test_config_parser.py::TestConfigParser::test_dict_substitutions tests/test_config_parser.py::TestConfigParser::test_list_substitutions tests/test_config_parser.py::TestConfigParser::test_non_existent_substitution tests/test_config_parser.py::TestConfigParser::test_non_compatible_substitution tests/test_config_parser.py::TestConfigParser::test_concat_multi_line_string tests/test_config_parser.py::TestConfigParser::test_concat_multi_line_list tests/test_config_parser.py::TestConfigParser::test_concat_multi_line_dict tests/test_config_parser.py::TestConfigParser::test_parse_URL_from_samples tests/test_config_parser.py::TestConfigParser::test_include_dict_from_samples tests/test_config_parser.py::TestConfigParser::test_list_of_dicts tests/test_config_parser.py::TestConfigParser::test_list_of_lists tests/test_config_parser.py::TestConfigParser::test_list_of_dicts_with_merge tests/test_config_parser.py::TestConfigParser::test_list_of_lists_with_merge tests/test_config_parser.py::TestConfigParser::test_invalid_assignment tests/test_config_parser.py::TestConfigParser::test_invalid_dict tests/test_config_parser.py::TestConfigParser::test_include_list tests/test_config_parser.py::TestConfigParser::test_include_dict tests/test_config_parser.py::TestConfigParser::test_include_substitution tests/test_config_parser.py::TestConfigParser::test_substitution_override tests/test_config_parser.py::TestConfigParser::test_substitution_flat_override tests/test_config_parser.py::TestConfigParser::test_substitution_nested_override tests/test_config_parser.py::TestConfigParser::test_optional_substitution tests/test_config_parser.py::TestConfigParser::test_substitution_cycle tests/test_config_parser.py::TestConfigParser::test_assign_number_with_eol tests/test_config_parser.py::TestConfigParser::test_assign_strings_with_eol tests/test_config_parser.py::TestConfigParser::test_assign_list_numbers_with_eol tests/test_config_parser.py::TestConfigParser::test_assign_list_strings_with_eol tests/test_config_parser.py::TestConfigParser::test_assign_dict_strings_with_equal_sign_with_eol tests/test_config_parser.py::TestConfigParser::test_assign_dict_strings_no_equal_sign_with_eol tests/test_config_parser.py::TestConfigParser::test_substitutions_overwrite tests/test_config_parser.py::TestConfigParser::test_fallback_substitutions_overwrite tests/test_config_parser.py::TestConfigParser::test_fallback_substitutions_overwrite_file tests/test_config_parser.py::TestConfigParser::test_one_line_quote_escape tests/test_config_parser.py::TestConfigParser::test_multi_line_escape
pyhocon/tool.py pyhocon/config_tree.py pyhocon/config_parser.py
pyhocon/tool.py pyhocon/config_tree.py pyhocon/config_parser.py