JSON Formatter & Validator

Pretty-print JSON strings and check for syntax errors.

Result will appear here.

πŸ“– How to Use

1
Enter JSON

Paste a JSON string into the input field. e.g. {"name":"WebTools","version":1}

2
Choose Options

Toggle key sorting and adjust indentation (2 or 4 spaces).

3
Format or Minify

Click ✨ Format to pretty-print, or πŸ—œοΈ Minify to remove whitespace.

4
Copy Result

Click πŸ“‹ Copy to save the formatted JSON to your clipboard.

πŸ’‘ Tip: JSON is processed entirely in your browser. No data is sent to any server β€” safe for sensitive information.

About the JSON Formatter

JSON (JavaScript Object Notation, RFC 8259) is a lightweight, text-based format for exchanging structured data between systems. Despite the name, it is language-independent and has become the de-facto standard for REST APIs, configuration files, NoSQL document stores such as MongoDB, and serialized application state. This formatter takes any JSON string — whether minified onto a single line, deeply nested, or returned raw from an API response — and re-emits it with consistent indentation so a human can actually read it.

How the formatter works

The tool parses your input with a strict JSON parser (the same grammar a browser uses), so it only accepts syntactically valid JSON. When parsing succeeds, the value is re-serialized with a configurable indent of 2 or 4 spaces and optional alphabetical key sorting. When parsing fails, the tool reports the position of the syntax error instead of silently producing wrong output — which is what makes it a validator as well as a beautifier. Everything runs in your browser through the native JSON.parse / JSON.stringify pipeline; not a byte of your input is transmitted anywhere.

A few rules are worth remembering: JSON requires double-quoted strings (single quotes are invalid), keys must always be strings, and a trailing comma after the last element is a syntax error. Numbers such as 1e3 and 0.5 are valid, but NaN and Infinity are not.

Common use cases

  • Pretty-printing a minified API response to inspect nested fields
  • Debugging a failing JSON.parse by locating the exact error position
  • Normalizing indentation before committing a .json config file
  • Sorting object keys for stable, reviewable diffs in version control
  • Shrinking payload size with the Minify action before sending over the network

Worked example

Given minified input:

{"user":"ada","roles":["admin","editor"],"meta":{"active":true,"logins":42}}

Formatting with a 2-space indent (and key sorting on) yields:

{
  "meta": {
    "active": true,
    "logins": 42
  },
  "roles": [
    "admin",
    "editor"
  ],
  "user": "ada"
}

Because JSON objects are unordered, reordering keys changes nothing about the meaning of the data — only how it reads.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting run entirely in your browser through the native JSON.parse / JSON.stringify APIs. Your input never leaves your device, so it is safe for tokens, credentials, and production data.

Why does my JSON show a syntax error?

The most common causes are single quotes instead of double quotes, a trailing comma after the last item, an unquoted key, or a raw control character inside a string. The tool reports the character position so you can jump straight to the mistake.

What is the difference between Format and Minify?

Format adds indentation and newlines for readability. Minify removes all optional whitespace to produce the smallest valid string, which is ideal for transmission and storage.

Does sorting keys change the data?

No. JSON objects are unordered by specification, so reordering keys never changes meaning. Sorting only produces stable, diff-friendly output.

Is there a maximum input size?

There is no artificial limit, but very large documents (tens of MB) can freeze the tab while parsing. For multi-gigabyte files, a streaming parser is a better fit than an in-browser formatter.

JSON ν¬λ§€ν„°λž€?

JSON(JavaScript Object Notation, RFC 8259)은 μ‹œμŠ€ν…œ 간에 κ΅¬μ‘°ν™”λœ 데이터λ₯Ό μ£Όκ³ λ°›κΈ° μœ„ν•œ 가볍고 ν…μŠ€νŠΈ 기반의 ν˜•μ‹μž…λ‹ˆλ‹€. 이름과 달리 언어에 독립적이며, REST API, μ„€μ • 파일, MongoDB 같은 NoSQL λ¬Έμ„œ μ €μž₯μ†Œ, μ§λ ¬ν™”λœ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μƒνƒœ λ“±μ—μ„œ 사싀상 ν‘œμ€€μœΌλ‘œ 자리 μž‘μ•˜μŠ΅λ‹ˆλ‹€. 이 ν¬λ§€ν„°λŠ” ν•œ μ€„λ‘œ μ••μΆ•λ˜μ—ˆκ±°λ‚˜ 깊게 μ€‘μ²©λ˜μ—ˆκ±°λ‚˜ API μ‘λ‹΅μœΌλ‘œ κ·ΈλŒ€λ‘œ λ‚΄λ €μ˜¨ μ–΄λ–€ JSON λ¬Έμžμ—΄μ΄λ“  μΌκ΄€λœ λ“€μ—¬μ“°κΈ°λ‘œ λ‹€μ‹œ 좜λ ₯ν•΄ μ‚¬λžŒμ΄ 읽을 수 있게 λ§Œλ“€μ–΄ μ€λ‹ˆλ‹€.

μž‘λ™ 방식

이 λ„κ΅¬λŠ” μž…λ ₯을 μ—„κ²©ν•œ JSON νŒŒμ„œ(λΈŒλΌμš°μ €κ°€ μ‚¬μš©ν•˜λŠ” 것과 같은 문법)둜 λΆ„μ„ν•˜λ―€λ‘œ, λ¬Έλ²•μ μœΌλ‘œ μœ νš¨ν•œ JSON만 λ°›μ•„λ“€μž…λ‹ˆλ‹€. νŒŒμ‹±μ— μ„±κ³΅ν•˜λ©΄ 값을 2μΉΈ λ˜λŠ” 4칸의 ꡬ성 κ°€λŠ₯ν•œ 듀여쓰기와 선택적 ν‚€ μ•ŒνŒŒλ²³ μ •λ ¬λ‘œ λ‹€μ‹œ μ§λ ¬ν™”ν•©λ‹ˆλ‹€. νŒŒμ‹±μ— μ‹€νŒ¨ν•˜λ©΄ 잘λͺ»λœ κ²°κ³Όλ₯Ό 쑰용히 λ‚΄λŠ” λŒ€μ‹  ꡬ문 였λ₯˜μ˜ μœ„μΉ˜λ₯Ό μ•Œλ € μ€λ‹ˆλ‹€ — 덕뢄에 검증기 역할도 ν•¨κ»˜ ν•©λ‹ˆλ‹€. λͺ¨λ“  μ²˜λ¦¬λŠ” λΈŒλΌμš°μ € μ•ˆμ—μ„œ λ„€μ΄ν‹°λΈŒ JSON.parse / JSON.stringify νŒŒμ΄ν”„λΌμΈμœΌλ‘œ 이루어지며, μž…λ ₯의 μ–΄λ–€ λ°”μ΄νŠΈλ„ μ™ΈλΆ€λ‘œ μ „μ†‘λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

λͺ‡ κ°€μ§€ κ·œμΉ™μ„ κΈ°μ–΅ν•΄ 두면 μ’‹μŠ΅λ‹ˆλ‹€. JSON은 ν°λ”°μ˜΄ν‘œ λ¬Έμžμ—΄λ§Œ ν—ˆμš©ν•©λ‹ˆλ‹€(μž‘μ€λ”°μ˜΄ν‘œλŠ” 잘λͺ»λ¨). ν‚€λŠ” 항상 λ¬Έμžμ—΄μ΄μ–΄μ•Ό ν•˜λ©°, λ§ˆμ§€λ§‰ μ›μ†Œ λ’€μ˜ ν›„ν–‰ μ‰Όν‘œλŠ” ꡬ문 였λ₯˜μž…λ‹ˆλ‹€. 1e3μ΄λ‚˜ 0.5 같은 μˆ«μžλŠ” μœ νš¨ν•˜μ§€λ§Œ NaNκ³Ό InfinityλŠ” μœ νš¨ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

자주 μ“°λŠ” 경우

  • μ΅œμ†Œν™”λœ API 응닡을 보기 μ’‹κ²Œ 펼쳐 쀑첩 ν•„λ“œ ν™•μΈν•˜κΈ°
  • μ‹€νŒ¨ν•œ JSON.parse의 μ •ν™•ν•œ 였λ₯˜ μœ„μΉ˜λ₯Ό μ°Ύμ•„ λ””λ²„κΉ…ν•˜κΈ°
  • .json μ„€μ • νŒŒμΌμ„ μ»€λ°‹ν•˜κΈ° μ „ λ“€μ—¬μ“°κΈ° ν†΅μΌν•˜κΈ°
  • 버전 κ΄€λ¦¬μ—μ„œ μ•ˆμ •μ μ΄κ³  κ²€ν† ν•˜κΈ° μ‰¬μš΄ diffλ₯Ό μœ„ν•΄ 객체 ν‚€ μ •λ ¬ν•˜κΈ°
  • λ„€νŠΈμ›Œν¬ 전솑 전에 Minify λ™μž‘μœΌλ‘œ νŽ˜μ΄λ‘œλ“œ 크기 쀄이기

μ‚¬μš© 예

μ΅œμ†Œν™”λœ μž…λ ₯이 μ£Όμ–΄μ§€λ©΄:

{"user":"ada","roles":["admin","editor"],"meta":{"active":true,"logins":42}}

2μΉΈ λ“€μ—¬μ“°κΈ°(ν‚€ μ •λ ¬ 켜짐)둜 ν¬λ§·ν•˜λ©΄:

{
  "meta": {
    "active": true,
    "logins": 42
  },
  "roles": [
    "admin",
    "editor"
  ],
  "user": "ada"
}

JSON κ°μ²΄λŠ” μˆœμ„œκ°€ μ—†μœΌλ―€λ‘œ ν‚€λ₯Ό μž¬μ •λ ¬ν•΄λ„ λ°μ΄ν„°μ˜ μ˜λ―ΈλŠ” 달라지지 μ•ŠμŠ΅λ‹ˆλ‹€ — λ‹¬λΌμ§€λŠ” 것은 μ½λŠ” λ°©μ‹λΏμž…λ‹ˆλ‹€.

자주 λ¬»λŠ” 질문

제 JSON이 μ„œλ²„λ‘œ μ „μ†‘λ˜λ‚˜μš”?

μ•„λ‹™λ‹ˆλ‹€. νŒŒμ‹±κ³Ό 포맷은 μ „μ μœΌλ‘œ λΈŒλΌμš°μ €μ—μ„œ λ„€μ΄ν‹°λΈŒ JSON.parse / JSON.stringify API둜 μ²˜λ¦¬λ©λ‹ˆλ‹€. μž…λ ₯은 κΈ°κΈ°λ₯Ό λ– λ‚˜μ§€ μ•ŠμœΌλ―€λ‘œ 토큰, 자격증λͺ…, 운영 데이터에도 μ•ˆμ „ν•©λ‹ˆλ‹€.

JSONμ—μ„œ ꡬ문 였λ₯˜κ°€ λ‚˜λŠ” μ΄μœ λŠ”?

κ°€μž₯ ν”ν•œ 원인은 ν°λ”°μ˜΄ν‘œ λŒ€μ‹  μž‘μ€λ”°μ˜΄ν‘œ, λ§ˆμ§€λ§‰ ν•­λͺ© λ’€μ˜ ν›„ν–‰ μ‰Όν‘œ, λ”°μ˜΄ν‘œ μ—†λŠ” ν‚€, λ¬Έμžμ—΄ μ•ˆμ˜ μ œμ–΄ λ¬Έμžμž…λ‹ˆλ‹€. 도ꡬ가 문자 μœ„μΉ˜λ₯Ό μ•Œλ € μ£Όμ–΄ ν•΄λ‹Ή μœ„μΉ˜λ‘œ λ°”λ‘œ 이동할 수 μžˆμŠ΅λ‹ˆλ‹€.

Formatκ³Ό Minify의 μ°¨μ΄λŠ”?

Format은 가독성을 μœ„ν•΄ 듀여쓰기와 μ€„λ°”κΏˆμ„ μΆ”κ°€ν•©λ‹ˆλ‹€. MinifyλŠ” 전솑과 μ €μž₯에 μ ν•©ν•œ κ°€μž₯ μž‘μ€ 유효 λ¬Έμžμ—΄μ„ λ§Œλ“€κΈ° μœ„ν•΄ λͺ¨λ“  선택적 곡백을 μ œκ±°ν•©λ‹ˆλ‹€.

ν‚€ 정렬이 데이터λ₯Ό λ°”κΎΈλ‚˜μš”?

μ•„λ‹™λ‹ˆλ‹€. JSON κ°μ²΄λŠ” 사양상 μˆœμ„œκ°€ μ—†μœΌλ―€λ‘œ ν‚€ μˆœμ„œλ₯Ό 바꿔도 μ˜λ―ΈλŠ” λ³€ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. 정렬은 μ•ˆμ •μ μ΄κ³  diffν•˜κΈ° μ‰¬μš΄ 좜λ ₯을 λ§Œλ“€ λΏμž…λ‹ˆλ‹€.

μ΅œλŒ€ μž…λ ₯ 크기가 μžˆλ‚˜μš”?

μΈμœ„μ μΈ μ œν•œμ€ μ—†μ§€λ§Œ, μ•„μ£Ό 큰 λ¬Έμ„œ(μˆ˜μ‹­ MB)λŠ” νŒŒμ‹± 쀑 탭을 λ©ˆμΆ”κ²Œ ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 수 GB νŒŒμΌμ—λŠ” λΈŒλΌμš°μ € λ‚΄ 포맀터보닀 슀트리밍 νŒŒμ„œκ°€ 더 μ ν•©ν•©λ‹ˆλ‹€.