JSON to JavaScript converter for SEO
Convert JSON to a JavaScript object, or turn JSON-LD schema markup into a script you can paste into Google Tag Manager. Free, runs in your browser, nothing is uploaded.
When to use it
SEO work often means adding structured data (JSON-LD) to pages you cannot edit directly. On many sites the only way in is Google Tag Manager or a script box, and that needs JavaScript, not raw JSON.
Paste your JSON or schema markup and get a clean JavaScript object, a ready-to-paste script that adds the JSON-LD to the page head, a normal JSON-LD script tag, or a dataLayer.push call. It also warns you when @context or @type is missing.
How it works
- Paste your JSON or JSON-LD, or press the example button.
- Choose the output: JavaScript object, JSON-LD injected with JavaScript, a script tag, or dataLayer.push.
- Copy the code, or download it, and paste it where you need it.
Questions
Why inject JSON-LD with JavaScript?
When you cannot edit the page template, a Custom HTML tag in Google Tag Manager can add the schema for you. The injected script creates a JSON-LD tag in the page head when the page loads.
Will Google read JSON-LD added by JavaScript?
Google can read structured data added with JavaScript once it renders the page. Adding it in the HTML itself is still the safest choice, so use the script tag option when you can. Always test the page with the Rich Results Test.
What is the difference between JSON and a JavaScript object?
JSON needs double quotes around every key and string. A JavaScript object can use single quotes, leave simple keys unquoted, and have trailing commas. This tool lets you choose.
Does it check my schema?
It checks that the JSON is valid and warns if @context or @type is missing. It does not check which properties a rich result needs, so validate the final page with Google's Rich Results Test.
Is my JSON uploaded anywhere?
No. The conversion runs in your browser tab and nothing is sent to a server.
Did this help?
Tell me what worked, what broke, or what tool you want next. I read every message.
Send feedback