diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc
index ac1d4cb..7dc4796 100644
--- a/core/includes/ajax.inc
+++ b/core/includes/ajax.inc
@@ -5,6 +5,7 @@
  * Functions for use with Drupal's Ajax framework.
  */
 
+use Drupal\Component\Utility\Json;
 use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
 
 /**
@@ -299,7 +300,7 @@ function ajax_render($commands = array()) {
   // Allow modules to alter any Ajax response.
   drupal_alter('ajax_render', $commands);
 
-  return drupal_json_encode($commands);
+  return Json::encode($commands);
 }
 
 /**
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
index b9f6582..df29092 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
@@ -7,6 +7,7 @@
 namespace Drupal\Core\Asset;
 
 use Drupal\Core\Asset\AssetCollectionRendererInterface;
+use Drupal\Component\Utility\Json;
 
 /**
  * Renders JavaScript assets.
@@ -54,7 +55,7 @@ public function render(array $js_assets) {
       switch ($js_asset['type']) {
         case 'setting':
           $element['#value_prefix'] = $embed_prefix;
-          $element['#value'] = 'var drupalSettings = ' . drupal_json_encode(drupal_merge_js_settings($js_asset['data'])) . ";";
+          $element['#value'] = 'var drupalSettings = ' . Json::encode(drupal_merge_js_settings($js_asset['data'])) . ";";
           $element['#value_suffix'] = $embed_suffix;
           break;
 
diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php
index 1faaa05..12f0f01 100644
--- a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php
+++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php
@@ -15,6 +15,7 @@
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\editor\Entity\Editor as EditorEntity;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\Component\Utility\Json;
 
 /**
  * Defines a CKEditor-based text editor for Drupal.
@@ -105,7 +106,7 @@ public function settingsForm(array $form, array &$form_state, EditorEntity $edit
     $form['toolbar']['buttons'] = array(
       '#type' => 'textarea',
       '#title' => t('Toolbar buttons'),
-      '#default_value' => json_encode($editor->settings['toolbar']['buttons']),
+      '#default_value' => Json::encode($editor->settings['toolbar']['buttons']),
       '#attributes' => array('class' => array('ckeditor-toolbar-textarea')),
     );
 
diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php
index e0e3cac..df8d3bc 100644
--- a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php
+++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\editor\Entity\Editor;
 use Drupal\simpletest\WebTestBase;
+use Drupal\Component\Utility\Json;
 
 /**
  * Tests administration of CKEditor.
@@ -98,7 +99,7 @@ function testAdmin() {
 
     // Ensure the toolbar buttons configuration value is initialized to the
     // expected default value.
-    $expected_buttons_value = json_encode($expected_default_settings['toolbar']['buttons']);
+    $expected_buttons_value = Json::encode($expected_default_settings['toolbar']['buttons']);
     $this->assertFieldByName('editor[settings][toolbar][buttons]', $expected_buttons_value);
 
     // Ensure the styles textarea exists and is initialized empty.
@@ -136,7 +137,7 @@ function testAdmin() {
       array('JustifyCenter'),
     );
     $edit = array(
-      'editor[settings][toolbar][buttons]' => json_encode($expected_settings['toolbar']['buttons']),
+      'editor[settings][toolbar][buttons]' => Json::encode($expected_settings['toolbar']['buttons']),
     );
     $this->drupalPost(NULL, $edit, t('Save configuration'));
     $editor = entity_load('editor', 'filtered_html');
diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php
index 2cd5854..4a901e4 100644
--- a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php
+++ b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php
@@ -18,6 +18,7 @@
 use Drupal\Core\Routing\UrlGeneratorInterface;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\Component\Utility\Json;
 
 /**
  * Construct the storage changes in a configuration synchronization form.
@@ -182,7 +183,7 @@ public function buildForm(array $form, array &$form_state) {
           'attributes' => array(
             'class' => array('use-ajax'),
             'data-accepts' => 'application/vnd.drupal-modal',
-            'data-dialog-options' => json_encode(array(
+            'data-dialog-options' => Json::encode(array(
               'width' => 700
             )),
           ),
diff --git a/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php b/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php
index 30de8f9..b4b63e6 100644
--- a/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php
+++ b/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Annotation\PluginID;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
+use Drupal\Component\Utility\Json;
 
 /**
  * Provides a handler that adds contextual links.
@@ -105,7 +106,7 @@ public function render(ResultRow $values) {
           '',
           array(),
           array(
-            'contextual-views-field-links' => drupal_encode_path(drupal_json_encode($links)),
+            'contextual-views-field-links' => drupal_encode_path(Json::encode($links)),
           )
         )
       );
diff --git a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php
index 6be87d0..c7a2914 100644
--- a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php
+++ b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\editor\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\Core\Language\Language;
 use Drupal\edit\EditorSelector;
 use Drupal\edit\MetadataGenerator;
@@ -196,6 +197,6 @@ function testGetUntransformedTextCommand() {
         'data' => 'Test',
       )
     );
-    $this->assertEqual(drupal_json_encode($expected), $response->prepare($request)->getContent(), 'The GetUntransformedTextCommand AJAX command works correctly.');
+    $this->assertEqual(Json::encode($expected), $response->prepare($request)->getContent(), 'The GetUntransformedTextCommand AJAX command works correctly.');
   }
 }
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index 9819f18..8ba7f8a 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -12,6 +12,7 @@
 
 use Drupal\Core\Language\Language;
 use Drupal\Component\Utility\Crypt;
+use Drupal\Component\Utility\Json;
 
 /**
  * Regular expression pattern used to localize JavaScript strings.
@@ -1341,7 +1342,7 @@ function _locale_rebuild_js($langcode = NULL) {
       $data .= "'pluralFormula': function (\$n) { return Number({$locale_plurals[$language->id]['formula']}); }, ";
     }
 
-    $data .= "'strings': " . drupal_json_encode($translations) . " };";
+    $data .= "'strings': " . Json::encode($translations) . " };";
     $data_hash = Crypt::hashBase64($data);
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
index a53b70f..afa763a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\Upgrade;
 
+use Drupal\Component\Utility\Json;
+
 /**
  * Tests upgrade of system variables.
  */
@@ -176,7 +178,7 @@ public function testVariableUpgrade() {
         $stored = $config->get($name);
         // Make sure we have a string representation to show.
         $stored_txt = !is_string($stored) ? json_encode($stored) : $stored;
-        $value_txt = !is_string($value) ? json_encode($value) : $value;
+        $value_txt = !is_string($value) ? Json::encode($value) : $value;
         $this->assertEqual($value, $stored, format_string('Expected value for %name found: %stored (previously: %value).', array('%name' => $name, '%stored' => $stored_txt, '%value' => $value_txt)));
       }
     }
diff --git a/core/modules/system/tests/modules/ajax_test/ajax_test.module b/core/modules/system/tests/modules/ajax_test/ajax_test.module
index e358018..de95c90 100644
--- a/core/modules/system/tests/modules/ajax_test/ajax_test.module
+++ b/core/modules/system/tests/modules/ajax_test/ajax_test.module
@@ -5,6 +5,7 @@
  * Helper module for Ajax framework tests.
  */
 
+use Drupal\Component\Utility\Json;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\AlertCommand;
 use Drupal\Core\Ajax\OpenDialogCommand;
@@ -136,7 +137,7 @@ function ajax_test_dialog() {
         'attributes' => array(
           'class' => array('use-ajax'),
           'data-accepts' => 'application/vnd.drupal-modal',
-          'data-dialog-options' => json_encode(array(
+          'data-dialog-options' => Json::encode(array(
             'width' => 400,
           ))
         ),
@@ -147,7 +148,7 @@ function ajax_test_dialog() {
         'attributes' => array(
           'class' => array('use-ajax'),
           'data-accepts' => 'application/vnd.drupal-dialog',
-          'data-dialog-options' => json_encode(array(
+          'data-dialog-options' => Json::encode(array(
             'target' => 'ajax-test-dialog-wrapper-1',
             'width' => 800,
           ))
@@ -174,7 +175,7 @@ function ajax_test_dialog() {
         'attributes' => array(
           'class' => array('use-ajax'),
           'data-accepts' => 'application/vnd.drupal-modal',
-          'data-dialog-options' => json_encode(array(
+          'data-dialog-options' => Json::encode(array(
             'width' => 800,
             'height' => 500,
           ))
@@ -186,7 +187,7 @@ function ajax_test_dialog() {
         'attributes' => array(
           'class' => array('use-ajax'),
           'data-accepts' => 'application/vnd.drupal-dialog',
-          'data-dialog-options' => json_encode(array(
+          'data-dialog-options' => Json::encode(array(
             'width' => 800,
           ))
         ),
diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index fa16bf9..41c17b8 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -5,6 +5,7 @@
  * Helper module for the form API tests.
  */
 
+use Drupal\Component\Utility\Json;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Language\Language;
@@ -1115,7 +1116,7 @@ function form_test_form_state_values_clean_form_submit($form, &$form_state) {
   form_state_values_clean($form_state);
   // This won't have a proper JSON header, but Drupal doesn't check for that
   // anyway so this is fine until it's replaced with a JsonResponse.
-  print drupal_json_encode($form_state['values']);
+  print Json::encode($form_state['values']);
   exit;
 }
 
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
index 2195b55..3ffe7ff 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
@@ -9,6 +9,8 @@
 
 use Drupal\Core\Language\Language;
 
+use Drupal\Component\Utility\Json;
+
 /**
  * Tests for taxonomy term functions.
  */
@@ -270,7 +272,7 @@ function testTermAutocompletion() {
     $path = 'taxonomy/autocomplete/taxonomy_' . $this->vocabulary->id();
     $this->drupalGet($path, array('query' => array('q' => $input)));
     $target = array($first_term->label() => check_plain($first_term->label()));
-    $this->assertRaw(drupal_json_encode($target), 'Autocomplete returns only the expected matching term.');
+    $this->assertRaw(Json::encode($target), 'Autocomplete returns only the expected matching term.');
 
     // Try to autocomplete a term name with both a comma and a slash.
     $input = '"term with, comma and / a';
@@ -282,7 +284,7 @@ function testTermAutocompletion() {
       $n = '"' . str_replace('"', '""', $third_term->label()) . '"';
     }
     $target = array($n => check_plain($third_term->label()));
-    $this->assertRaw(drupal_json_encode($target), 'Autocomplete returns a term containing a comma and a slash.');
+    $this->assertRaw(Json::encode($target), 'Autocomplete returns a term containing a comma and a slash.');
   }
 
   /**
