diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Mustache library changelog
 
+## v2.4.0
+
+- Support for aeson 2
+
 ## v2.3.2
 
 - Added support for GHC 9.0.1
diff --git a/mustache.cabal b/mustache.cabal
--- a/mustache.cabal
+++ b/mustache.cabal
@@ -5,7 +5,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           mustache
-version:        2.3.2
+version:        2.4.0
 synopsis:       A mustache template parser library.
 description:    Allows parsing and rendering template files with mustache markup. See the
                 mustache <http://mustache.github.io/mustache.5.html language reference>.
@@ -18,7 +18,7 @@
 bug-reports:    https://github.com/JustusAdam/mustache/issues
 author:         Justus Adam
 maintainer:     dev@justus.science
-copyright:      (c) 2015 - 2019 Justus Adam
+copyright:      (c) 2015 - 2022 Justus Adam
 license:        BSD3
 license-file:   LICENSE
 build-type:     Simple
diff --git a/src/Text/Mustache/Internal/Types.hs b/src/Text/Mustache/Internal/Types.hs
--- a/src/Text/Mustache/Internal/Types.hs
+++ b/src/Text/Mustache/Internal/Types.hs
@@ -12,6 +12,9 @@
 import           Control.Arrow
 import           Control.Monad.RWS        hiding (lift)
 import qualified Data.Aeson               as Aeson
+#if MIN_VERSION_aeson(2,0,0)
+import qualified Data.Aeson.KeyMap        as KM
+#endif
 import           Data.Int                 (Int8, Int16, Int32, Int64)
 import           Data.Foldable            (toList)
 import qualified Data.HashMap.Strict      as HM
@@ -269,7 +272,12 @@
     toMustache = Lambda
 
 instance ToMustache Aeson.Value where
-  toMustache (Aeson.Object o) = Object $ fmap toMustache o
+  toMustache (Aeson.Object o) = Object $ fmap toMustache
+#if MIN_VERSION_aeson(2,0,0)
+    (KM.toHashMapText o)
+#else
+    o
+#endif
   toMustache (Aeson.Array  a) = Array $ fmap toMustache a
   toMustache (Aeson.Number n) = Number n
   toMustache (Aeson.String s) = String s
