JSON
Validate, pretty-print, and minify JSON entirely in your browser.
{
"name": "renderhub",
"type": "ssg",
"features": [
"preview",
"edit",
"download"
],
"ads": {
"provider": "adsense",
"enabled": true
}
}Tools
- Format — pretty-print with chosen indent.
- Minify — strip whitespace.
- Errors show inline on the right pane.
What is JSON, and what is this tool for?
JSON (JavaScript Object Notation) is the most common text format for moving structured data between systems — APIs, configuration files, log records, message queues. It is intentionally small: six value types (object, array, string, number, boolean, null) and a strict grammar that maps cleanly to almost every programming language. This page validates, formats, and minifies JSON in your browser, with errors reported as you type.
The errors you will actually see
- Trailing commas — perfectly valid JavaScript, illegal in JSON. The parser rejects
[1, 2, 3,]and{"a": 1,}. - Single quotes — JSON strings must use double quotes. Output from a Python repr or a careless copy from JavaScript often uses
'. - Unquoted keys —
{name: "ada"}is a JavaScript object literal, not JSON. Keys must always be quoted strings. - Comments — JSON proper has no comment syntax. If your config allows
//or/* */, it is JSON5 or JSONC, not JSON. - NaN, Infinity, undefined — these are JavaScript values, not JSON values. A number that fails to round-trip is usually one of these.
Format vs minify
Format pretty-prints with the indent you choose — useful when reviewing API responses or committing fixtures to source control. Minify strips all insignificant whitespace, producing the most compact representation; this is what you want before storing JSON in a database column, embedding it in a URL, or comparing the size of two payloads.
JSON vs JSON5 vs JSONC
If you maintain configuration files, you will run into JSON5 (trailing commas, single quotes, comments, unquoted keys) and JSONC (JSON with comments — used by VS Code and TypeScript tsconfig.json). Both are supersets: they accept everything valid JSON does, but valid JSON5 or JSONC is not necessarily valid JSON. When in doubt, run it through this tool — if it parses cleanly here, it is portable JSON.
JSON이란 무엇이고 이 도구는 무엇을 위한 것인가?
JSON(JavaScript Object Notation)은 시스템 간에 구조화된 데이터를 옮기는 가장 흔한 텍스트 포맷입니다 — API, 설정 파일, 로그, 메시지 큐 등. 의도적으로 작게 설계되었습니다. 여섯 가지 값 타입(객체, 배열, 문자열, 숫자, 불리언, null)과 엄격한 문법이 거의 모든 프로그래밍 언어에 깔끔하게 매핑됩니다. 이 페이지는 브라우저 안에서 JSON을 검증·포맷·압축하며, 입력 중 실시간으로 오류를 표시합니다.
실제로 자주 보게 되는 오류
- 후행 콤마 — 자바스크립트로는 유효하지만 JSON으로는 무효입니다. 파서는
[1, 2, 3,]이나{"a": 1,}를 거부합니다. - 작은따옴표 — JSON 문자열은 큰따옴표여야 합니다. 파이썬 repr이나 자바스크립트에서 부주의하게 복사한 출력은 보통
'를 씁니다. - 인용 없는 키 —
{name: "ada"}는 자바스크립트 객체 리터럴이지 JSON이 아닙니다. 키는 항상 인용된 문자열이어야 합니다. - 주석 — 표준 JSON에는 주석 문법이 없습니다. 설정 파일이
//나/* */를 허용한다면 그건 JSON5나 JSONC이지 JSON이 아닙니다. - NaN, Infinity, undefined — 이들은 자바스크립트 값이지 JSON 값이 아닙니다. 라운드트립에 실패하는 숫자는 대개 이 셋 중 하나입니다.
포맷 vs 압축
포맷은 선택한 들여쓰기로 보기 좋게 출력합니다 — API 응답을 검토하거나 픽스처를 저장소에 커밋할 때 유용합니다. 압축은 모든 불필요한 공백을 제거해 가장 콤팩트한 표현을 만듭니다. JSON을 DB 컬럼에 저장하거나 URL에 임베드하거나 두 페이로드의 크기를 비교할 때 필요합니다.
JSON vs JSON5 vs JSONC
설정 파일을 다루다 보면 JSON5(후행 콤마, 작은따옴표, 주석, 인용 없는 키)와 JSONC(주석이 있는 JSON — VS Code와 TypeScript tsconfig.json이 사용)를 만나게 됩니다. 둘 다 슈퍼셋입니다 — 유효한 JSON은 모두 받지만, 유효한 JSON5나 JSONC가 모두 유효한 JSON인 것은 아닙니다. 헷갈리면 이 도구에 통과시켜 보세요 — 여기서 깔끔하게 파싱되면 어디서든 통하는 JSON입니다.