JSON Syntax Highlighter
Syntax-highlight JSON for docs, email and slides — copy it with colours intact or as inline-styled HTML. Light, dark and Monokai themes.
Preview
About this result
What It Does
This tool colours JSON by meaning — keys, strings, numbers, booleans and null each get their own colour — and gives you the result in a form you can paste anywhere. Copy with colours puts rich HTML on the clipboard for Google Docs, Gmail or slides; Copy HTML gives you a self-contained snippet with inline styles for a blog, wiki or email template. Valid JSON can be re-indented first, and invalid JSON is still highlighted, with the bad characters marked in red.
When to Use It
- You are writing API documentation or a README and want a response example that reads at a glance.
- You need to drop a JSON payload into a slide deck or an email to a colleague without losing formatting.
- Your CMS or wiki has no code highlighting, but it accepts raw HTML.
- You want to spot at a glance where a long document stops being valid JSON.
Worked Examples
{"id":42,"name":"Ada","admin":true,"tags":["math","engines"],"manager":null}
Formatted and coloured: keys in one colour, strings in another, and true and null standing out from the data around them.
{
"status": "ok",
"data": { "items": [1, 2, 3], "next": null }
}
The dark theme, for slides with a dark background. Turn on line numbers to reference lines in a talk.
{
"name": 'Ada',
"age": 36,
}
Invalid: the single quotes are marked in red, and the notes give the line and column of the first error.
Features
How to Use
1. Paste your JSON. 2. Choose a theme and whether to re-indent and show line numbers. 3. Click Copy with colours to paste into a document, or Copy HTML to embed the snippet in a web page or email template.
Common Mistakes
- Pasting the HTML source into a rich-text editor. You will see the tags as text — use Copy with colours for editors, and Copy HTML only where the destination expects raw HTML.
- Highlighting a 5 MB payload for a document. Inline styles add markup to every token, so the HTML is several times the size of the JSON — trim to the part that matters.
- Re-indenting broken JSON by hand to find the error. The highlighter marks the first character that cannot be JSON, which is usually faster.
Frequently Asked Questions
Highlighting runs entirely in your browser. Nothing is uploaded.