A polished, single-file JSON formatter, validator, and tree-view explorer — all in one HTML page. No build step, no dependencies, deploy anywhere.
🌐 Live Demo · Features · Usage · License
- Format — Pretty-prints JSON with full syntax highlighting (keys, strings, numbers, booleans, null)
- Minify — Compresses JSON to a single line
- Validate — Validates JSON syntax with detailed error messages including line & column numbers
- Tree View — Interactive expandable/collapsible JSON tree with clickable keys
- Drag & Drop — Drop
.jsonfiles directly onto the page - Copy — One-click copy of formatted output to clipboard
- Stats — Real-time character and line counts
- Dark Theme — Eye-friendly dark UI with orange accent
- Responsive — Works on desktop and mobile
- Zero Dependencies — Everything in one HTML file, no CDN, no build tools
Open index.html in any modern browser, or deploy to GitHub Pages / Netlify / any static host.
- Paste JSON into the input textarea (or drag-and-drop a
.jsonfile) - Click Format, Minify, Validate, or Tree
- Use Copy to grab the formatted output
Keyboard shortcut: Ctrl+Enter / Cmd+Enter to format.
flowchart LR
A["`Raw JSON Input`"] --> B{"Parse"}
B -- "✅ Valid" --> C["Format / Minify"]
B -- "✅ Valid" --> D["Tree View"]
B -- "❌ Error" --> E["Error Display<br>line + column"]
C --> F["Syntax Highlighted Output"]
F --> G["Copy to Clipboard"]
D --> H["Expand / Collapse<br>Interactive Tree"]
json-pretty/
├── index.html # Single-file application (~29 KB)
└── README.md # This file
| Token | Color | Example |
|---|---|---|
| Keys | Orange | "name" |
| Strings | Blue | "hello" |
| Numbers | Cyan | 42, 3.14 |
| Booleans | Purple | true, false |
| Null | Purple | null |
Licensed under the MIT License.