도구 가이드
developer 무료 회원가입 불필요

JSON 포매터 & 검증기

JSON 포맷 지정, 검증 및 최소화 — 구문 오류 위치 정확히 표시.

도구를 불러오는 중…

이 도구에 대해

JSON을 붙여넣으면 깔끔하게 정렬되거나 축소된 버전을 얻을 수 있습니다. 잘못된 JSON은 오류의 정확한 행과 열이 강조 표시됩니다. 최대 10MB 파일까지 작동합니다.

사용 방법

  1. 1 입력 영역에 JSON 텍스트를 붙여넣으세요.
  2. 2 읽기 쉬운 들여쓰기 출력을 위해 미화를 클릭하거나 공백을 제거하려면 축소를 클릭하세요.
  3. 3 오류가 있으면 정확한 행과 열이 강조 표시됩니다.
  4. 4 복사를 클릭하여 형식이 지정된 JSON을 클립보드에 복사하세요.

What "formatting" JSON actually does

JSON (JavaScript Object Notation) is a plain-text format for structured data: nested objects in curly braces, arrays in square brackets, and key/value pairs separated by commas. A machine doesn't care whether that text is squeezed onto one line or spread across fifty — both parse to the same data. Formatting changes only the whitespace between tokens. Beautifying inserts newlines and indentation so a human can read the structure; minifying removes every optional space so the payload is as small as possible. This tool does both by parsing your text into a real object with the browser's native JSON.parse(), then re-serialising it with JSON.stringify() — either with two-space indentation or with none.

Because it round-trips through a genuine parser, formatting here is also validation. If the parser can't read your text, it can't reformat it, and you get the exact error message instead. Everything runs locally in your browser; the JSON you paste is never uploaded.

A worked example

Paste this minified line:

{"user":{"name":"Ada","roles":["admin","editor"],"active":true},"count":2}

Beautify turns it into a readable tree:

  • user is an object containing name, roles, and active
  • roles is an array of two strings
  • active is the boolean true (not the string "true")
  • count is the number 2

Minify reverses the process, collapsing it back to the single compact line — useful when you need to embed JSON in a URL, a config value, or an API request body where every byte counts. The tool also reports the input size in bytes, so you can see exactly how much minifying saves.

Reading and fixing validation errors

The most valuable feature is the error message, because malformed JSON is the cause of countless silent API failures. The parser pinpoints where it gave up. The usual culprits:

  • Trailing comma. {"a":1,} is invalid — JSON forbids a comma before a closing brace or bracket, even though JavaScript object literals allow it.
  • Single quotes. Keys and strings must use double quotes. {'a':1} fails; it must be {"a":1}.
  • Unquoted keys. {a:1} is a JavaScript object literal, not JSON. Every key needs quotes.
  • Missing or extra comma between items. The error usually points at the token right after the problem, so check the line just before the reported position.
  • Smart quotes. Pasting from a word processor can replace " with curly “ ”, which the parser rejects.

Why JSON forbids comments

A frequent surprise: // like this or /* this */ will not parse. Comments were deliberately left out of the JSON spec so the format stays a pure, unambiguous data interchange. If your file has comments, it is really JSONC (JSON with Comments, used by tools like VS Code's settings) or JSON5. Strip the comments before formatting here, or use an editor that understands those relaxed dialects. The same applies to trailing commas, which JSON5 permits but standard JSON does not.

Practical use cases

  • Debugging API responses. Paste a one-line response from a server log and beautify it to see the structure at a glance.
  • Cleaning up before committing. Reformat configuration files (package.json, tsconfig.json) so diffs stay consistent across a team.
  • Shrinking payloads. Minify a large config before pasting it into an environment variable or a query string.
  • Sanity-checking generated JSON. Validate output from a script or an AI model before sending it downstream, catching syntax errors early.

Tips and common pitfalls

  • Numbers keep their type. Note that re-serialising can normalise number formatting — 1.0 becomes 1, and very large integers may lose precision because JavaScript numbers are 64-bit floats. If you need exact big-integer fidelity, treat such values as strings.
  • Key order is preserved. The tool keeps your keys in their original order rather than sorting them, so the only change you see is whitespace.
  • Duplicate keys collapse. If an object has the same key twice, the parser keeps only the last value — a silent data loss worth knowing about.
  • Mind the size. Parsing happens in memory, so files past roughly 10 MB can make the browser sluggish. For multi-megabyte data, a command-line tool such as jq is faster.
  • Validating isn't schema-checking. This tool confirms your JSON is syntactically correct, not that it matches the shape an API expects. For that, use JSON Schema validation.

자주 묻는 질문

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}