Report

Help us improve this tool

JSON-LD To Flattened

Flatten JSON-LD documents into a single node with real-time browser-side processing using a JSON-LD context.

O M T

Flatten JSON-LD graphs into a single node

JSON-LD flattening merges a graph of linked nodes into one document where all properties are collected on a single root node. Blank node identifiers are removed and nested references are inlined, producing a simplified structure that is easier to process in applications.

What this tool does

Paste a JSON-LD document (optionally with a separate context) and the converter applies the W3C JSON-LD flattening algorithm. The result is a single JSON object containing all graph data merged into one node.

When to use flattening

  • Simplify multi-node JSON-LD graphs for storage or API responses.
  • Prepare linked data for systems that expect a flat key-value structure.
  • Compare semantic content without navigating nested node references.
  • Transform schema.org markup into a single embeddable object.

Related tools

To reverse flattening or work with compact terms, use JSON-LD to Compacted or JSON-LD to Expanded. For RDF serialization, try JSON-LD to N-Quads.

Frequently Asked Questions

What is JSON-LD flattening?

Flattening takes a JSON-LD graph with multiple nodes and merges all properties into a single node. Node identifiers and graph structure are simplified while preserving the underlying RDF triples.

Is the context input required?

No. Context is optional. When provided, it helps the processor interpret terms during flattening. Documents that already include an inline @context work without a separate context input.

Does processing happen in the browser?

Yes. This tool uses the jsonld.js processor locally. Your documents are not uploaded to a server.

How is flattening different from compaction?

Compaction shortens IRIs using a context vocabulary. Flattening merges multiple graph nodes into one node regardless of term shortening. Both operations serve different normalization goals.