diff --git a/README.md b/README.md
index c5d7681..475cd5d 100644
--- a/README.md
+++ b/README.md
@@ -28,3 +28,15 @@ The list of endpoints then looks like the following:
 * `/jsonapi/node/article/{UUID}`: Exposes an individual article
 * `/jsonapi/block`: Exposes a collection of blocks
 * `/jsonapi/block/{block}`: Exposes an individual block
+
+## Development usage
+
+It is also possible to obtain the JSON representation of a supported entity:
+
+  // For a given $entity object.
+  $json = \Drupal::service('jsonapi.entity.to_json')->normalizeEntity($entity);
+
+Should it be needed, the raw string itself can be obtained:
+
+  // For a given $entity object.
+  $raw_output = \Drupal::service('jsonapi.entity.to_json')->serializeEntity($entity);
diff --git a/jsonapi.services.yml b/jsonapi.services.yml
index a9f0788..d283027 100644
--- a/jsonapi.services.yml
+++ b/jsonapi.services.yml
@@ -106,6 +106,10 @@ services:
       # middleware (priority 200)has the opportunity to respond.
       - { name: http_middleware, priority: 201 }
 
+  jsonapi.entity.to_json:
+    class: Drupal\jsonapi\ToJson
+    arguments: ['@serializer.normalizer.entity.jsonapi', '@serializer']
+
   logger.channel.jsonapi:
     parent: logger.channel_base
     arguments: ['jsonapi']
diff --git a/src/ToJson.php b/src/ToJson.php
new file mode 100644
index 0000000..cfde37c
--- /dev/null
+++ b/src/ToJson.php
@@ -0,0 +1,75 @@
+<?php
+
+namespace Drupal\jsonapi;
+
+use \Drupal\Core\Entity\EntityInterface;
+use Drupal\jsonapi\Normalizer\ContentEntityNormalizer;
+use Drupal\Core\Cache\CacheableMetadata;
+use Symfony\Component\Serializer\SerializerInterface;
+
+/**
+ * Provide JSON output for a given object.
+ */
+class ToJson {
+
+  /**
+   * A content entity normalizer.
+   *
+   * @var ContentEntityNormalizer
+   */
+  protected $normalizer;
+
+  /**
+   * Serializer object.
+   *
+   * @var SerializerInterface
+   */
+  protected $serializer;
+
+  /**
+   * Constructs a new EntityConverter.
+   *
+   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
+   *   The entity manager.
+   */
+  public function __construct(ContentEntityNormalizer $normalizer, SerializerInterface $serializer) {
+    $this->normalizer = $normalizer;
+    $this->serializer = $serializer;
+  }
+
+  /**
+   * Return the requested entity as a JSON object.
+   *
+   * @param \Drupal\Core\Entity\EntityInterface $entity
+   *   The entity to generate the JSON from.
+   * @param array $options
+   *   Optional arguments to pass to the HTTP Kernel request.
+   *
+   * @return \Drupal\Component\Serialization\Json
+   *   The requested resource in JSON form.
+   */
+  public function serializeEntity(EntityInterface $entity) {
+    $normalized_entity = $this->normalizeEntity($entity);
+    return $this->serializer->serialize($normalized_entity, 'json');
+  }
+
+  /**
+   * Return the requested entity as a raw string.
+   *
+   * @param \Drupal\Core\Entity\EntityInterface $entity
+   *   The entity to generate the JSON from.
+   * @param array $options
+   *   Optional arguments to pass to the HTTP Kernel request.
+   *
+   * @return string
+   *   The raw JSON string of the requested resource.
+   */
+  public function normalizeEntity(EntityInterface $entity) {
+    $this->normalizer->setSerializer($this->serializer);
+
+    return $this->normalizer
+      ->normalize($entity, 'api_json', ['account' => \Drupal::currentUser(), 'cacheable_metadata' => new CacheableMetadata()])
+      ->rasterizeValue();
+  }
+
+}
diff --git a/tests/src/Functional/JsonApiFunctionalToJsonTest.php b/tests/src/Functional/JsonApiFunctionalToJsonTest.php
new file mode 100644
index 0000000..d6a4403
--- /dev/null
+++ b/tests/src/Functional/JsonApiFunctionalToJsonTest.php
@@ -0,0 +1,51 @@
+<?php
+
+namespace Drupal\Tests\jsonapi\Functional;
+
+use Drupal\Component\Serialization\Json;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Test the ToJson functionality.
+ *
+ * @group jsonapi
+ */
+class JsonApiFunctionalToJsonTest extends JsonApiFunctionalTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    drupal_flush_all_caches();
+    $this->drupalGet('');
+  }
+
+  /**
+   * Check the output of the system service.
+   */
+  public function testService() {
+    $node = $this->createNode(['type' => 'article']);
+    $service = \Drupal::service('jsonapi.entity.to_json');
+
+    // Examine the raw response, i.e. a string.
+    $raw = $service->serializeEntity($node);
+    $this->htmlOutput(print_r($raw, TRUE));
+    $this->assertFalse(empty($raw));
+    $this->assertFalse(is_array($raw));
+
+    // Examine the JSON decoded response, i.e. an array.
+    $json = $service->normalizeEntity($node);
+    $this->htmlOutput(print_r($json, TRUE));
+    $this->assertFalse(empty($json));
+    $this->assertTrue(is_array($json));
+
+    // Make sure that the JSON output is actually valid.
+    $this->assertFalse(isset($json['errors']));
+
+    $this->assertEquals(Json::decode($raw), $json);
+    $this->assertNotEquals($raw, $json);
+  }
+
+}
