Free tool
JSON-LD Formatter
Pretty-print JSON-LD pasted bare or in script tags, list every @type and flag a missing @context.
How it works
What is the JSON-LD Formatter?
The JSON-LD Formatter is a free tool that cleans up structured data. Paste JSON-LD on its own or with its script tags, and it pretty-prints each block, lists every @type it finds, including nested ones, and warns when a block has no @context or is not valid JSON.
How to use the JSON-LD Formatter
- Paste JSON-LD, or a chunk of page source that contains
application/ld+jsonscript tags. - Choose the indentation, or Minify for a single line.
- Read the list of types found and any warnings under the output.
- Tick Wrap in a script tag if you want paste-ready markup, then copy it.
What is JSON-LD?
JSON-LD is a way of writing linked data as JSON. On websites it is the usual format for schema.org structured data: a script tag with the type application/ld+json that states facts about the page, such as its type, name, author or price, in a form machines read directly.
Google supports JSON-LD, Microdata and RDFa for structured data and recommends JSON-LD, because it sits in one block and does not have to be woven through the visible HTML.
How do I format JSON-LD from a web page?
View the page source, copy the part that contains the script tags, and paste it here. The tool pulls out every <script type="application/ld+json"> block, ignores the HTML around them, and formats each one. If it finds no script tag it treats the whole input as bare JSON.
Minified markup from a CMS or plugin becomes readable, and several blocks on one page are shown one after another in the order they appear.
Why does JSON-LD need @context?
@context tells a parser what vocabulary the property names belong to. With "@context": "https://schema.org", the word name means schema.org's name. Without it, the block is still valid JSON but the terms have no defined meaning, and structured data parsers will not read it as schema.org markup.
The tool checks the top level of each block, and each item if the block is an array. Nested objects do not need their own @context, because they inherit it from the block they sit in.
What does the list of @type values tell me?
It is a quick inventory of what the markup claims to describe. The tool walks the whole structure, including @graph arrays and nested objects, and counts every @type. You can see at a glance whether a page declares an Organization, a Product with an Offer, or three separate FAQPage blocks from competing plugins.
Duplicate or conflicting types on one page are a common cause of confusing validator results, and the list makes them easy to spot.
Is formatted JSON-LD the same as valid schema markup?
No. This tool checks three things: that each block is valid JSON, that @context is present, and which types are declared. It does not check whether a type has the properties Google requires for a rich result, or whether the values are in the right format.
For that, run the page through the Schema Markup Validator. To write new markup from a form instead of by hand, use the Schema Markup Generator.
Questions
- Where does JSON-LD go on a page?
- In a script tag with the type
application/ld+json, placed in the head or the body of the HTML. Google reads it in either place. - Can a page have more than one JSON-LD block?
- Yes. A page can carry several script tags, or one block that holds several items in an
@grapharray. Both are valid. The tool formats every block it finds. - What is @graph in JSON-LD?
@graphis an array that holds several items under one shared@context. Many SEO plugins use it to describe the site, the page and the organization together and link them with@id.- Why does the tool say my JSON-LD is not valid JSON?
- The usual causes are a trailing comma, a missing quote, or smart quotes pasted from a word processor. The message gives the line and column. The JSON Formatter shows the offending line as well.
- Is the JSON-LD Formatter free?
- Yes, with a free spyc.ai account. It runs in your browser, so nothing you type or paste is sent to a server.
Developer Tools
More in Developer Tools
JSON Formatter
Format, minify and validate JSON in your browser, with the line and column of the first syntax error.
Format JSONCase Converter
Convert text to upper, lower, title or sentence case, or to camelCase, PascalCase, snake_case and kebab-case.
Convert caseEm Dash Remover
Replace every em dash, and optionally en dashes, with a comma, hyphen or period, and count the changes.
Remove dashesReady when you are
Before your next buyer asks AI about you, ask AI about yourself
One check, four engines, about twenty seconds. We show you the answers before we ask for anything.