Free online JSON formatter to beautify, minify, and validate JSON. Supports syntax highlighting and instant preview.
Public API
Endpoint:
/api/format/json
Windows CMD:
curl -G "http://localhost:3000/api/format/json" ^\n --data-urlencode "input={\"name\":\"John\",\"age\":30}" ^\n --data-urlencode "style=pretty"Bash/Mac/Linux:
curl -G 'https://yourdomain.com/api/format/json' --data-urlencode 'input={"name":"John","age":30}' --data-urlencode 'style=pretty'Example fetch (browser):
const json = JSON.stringify({ name: 'John', age: 30 });
const res = await fetch('/api/format/json?input=' + encodeURIComponent(json) + '&style=pretty');
const data = await res.json();
console.log(data.result);💡 Tip: Paste invalid JSON to see helpful error messages. Use "Format" for pretty printing or "Minify" to reduce file size.
JSON formatting makes JSON code readable by adding proper indentation and spacing. It's useful for debugging and sharing code.
Yes, all processing happens in your browser. Your data is never sent to our servers.
Quickly format API responses to understand data structure
Make JSON readable before sharing with team members
Validate and format JSON configuration files
Input:
{
"name": "John",
"age": 30
}Output:
{"name":"John","age":30}