JSON Formatter

Free online JSON formatter to beautify, minify, and validate JSON. Supports syntax highlighting and instant preview.

developerFree & Private

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.

FAQ

What is JSON formatting?â–¼

JSON formatting makes JSON code readable by adding proper indentation and spacing. It's useful for debugging and sharing code.

Is my data private?â–¼

Yes, all processing happens in your browser. Your data is never sent to our servers.

Use Cases

API Debugging

Quickly format API responses to understand data structure

Code Review

Make JSON readable before sharing with team members

Configuration Files

Validate and format JSON configuration files

Examples

Minify JSON

Input:

{
  "name": "John",
  "age": 30
}

Output:

{"name":"John","age":30}