JSON 완전 가이드

무료 포맷 · 검증 · 변환 · 모범 사례 가입 불필요 · 데이터 저장 없음 · 오프라인 작동

이 가이드의 도구

JSON Formatter & Validator
Format, validate, minify and fix JSON
JSON to YAML Converter
Convert JSON to Kubernetes-ready YAML
JSON to CSV Converter
Export JSON arrays as spreadsheets
JSON to XML Converter
Convert JSON to well-formed XML
JSON to TOML Converter
Convert JSON to Rust/Python configs
JSON to TOON Converter
Token-efficient format for LLMs
YAML Formatter
Format and validate YAML config files
Base64 Encoder
Encode binary data for JSON payloads
Last updated: March 2026  ·  v1.0
Quick Answer
What is JSON formatting and why does it matter?

JSON formatting rewrites raw, minified JSON with consistent indentation to make it human-readable and debuggable. The 5 most important things to know:

  1. Use 2-space indent for web projects (Node.js/JS default), 4-space for Python/Java.
  2. All keys and string values must use double quotes — single quotes are invalid JSON.
  3. Trailing commas always cause parse errors, even after the last array/object element.
  4. JSON has no comment syntax — // and /* */ both break parsing.
  5. Dates have no native type — always use ISO 8601 strings: 2024-01-15T10:30:00Z.

JSON (JavaScript Object Notation) is the universal language of web APIs, configuration files, and data exchange. Whether you are debugging an API response, migrating data between systems, or configuring a cloud service, you need reliable JSON tooling in your browser — no install, no signup, no data leaving your machine.

What is JSON and why does formatting matter?

JSON is a lightweight text format derived from JavaScript object syntax. It uses key-value pairs and ordered lists to represent structured data, and every major programming language can parse and generate it natively.

Raw JSON from an API often arrives minified — a single line with no whitespace. While this saves bandwidth, it is unreadable to humans. A JSON formatter reindents it with consistent spacing, making nested structures instantly visible. Proper formatting is not cosmetic: it directly affects your ability to spot missing brackets, misplaced commas, and type mismatches that cause runtime errors.

JSON formatting: 2-space, 4-space, or tab?

The JSON specification (RFC 8259) imposes no indentation rules. In practice, three conventions dominate.

2-space indentation is favoured by JavaScript and Node.js communities. It balances readability with compactness, keeping deeply nested structures on screen without horizontal scrolling. Most linters and editors default to 2 spaces for JSON.

4-space indentation is common in Python and Java projects. It makes each nesting level more visually distinct, which helps when reading deeply nested API responses.

Tab indentation allows each developer to choose their display width in their editor. It is common in C and Go projects. Our JSON Formatter supports all three. For most web API work, 2-space is the right default.

Common JSON validation errors and how to fix them

JSON is strict — a single character out of place breaks the entire document. Here are the five most common errors:

Trailing commas — JSON forbids a comma after the last item in an object or array. {"a":1, "b":2,} is invalid. Use the Fix Quotes button to catch this automatically.

Single quotes — JSON requires double quotes for all strings and keys. {'key': 'value'} is invalid JSON. Use the Fix Quotes button to convert automatically.

Unquoted keys — JavaScript objects allow bare keys, but JSON does not. Every key must be a double-quoted string.

Comments — JSON has no comment syntax. Both // and /* */ comments cause parse errors. Strip them before validating.

NaN and Infinity — Valid in JavaScript but not in JSON. Replace with null or a sentinel number like -1.

Converting JSON to other formats

Different systems need data in different shapes. Here is when to use each converter:

JSON → YAML — YAML is the standard for Kubernetes manifests, Docker Compose files, GitHub Actions workflows, and most CI/CD pipelines. Convert when moving configuration from a JSON-based tool to a YAML-based one.

JSON → CSV — Spreadsheet tools and data pipelines expect CSV. Convert a JSON array of objects to a CSV where each object becomes a row and each key becomes a column header.

JSON → XML — Legacy enterprise systems, SOAP APIs, and many Java frameworks use XML. Convert JSON payloads to well-formed XML for integration with these systems.

JSON → TOML — Rust's Cargo, Python's pyproject.toml, and Hugo's config files use TOML. TOML is more explicit than YAML and better suited for human-edited configuration files.

All conversions run entirely in your browser. No data is sent to any server.

JSON best practices for APIs and configuration

Use snake_case for keys consistently across your API. Mixing userId and user_id in the same codebase creates unnecessary mapping code.

Avoid deeply nested structures. If your JSON is 6+ levels deep, it is a sign the data model needs refactoring. Flat structures are easier to serialize, deserialize, and cache.

Represent missing data as null, not absent. {"email": null} communicates intent better than omitting the key entirely.

Use ISO 8601 for dates. JSON has no native date type. Always use strings in ISO 8601 format (2024-01-15T10:30:00Z) rather than Unix timestamps or locale-specific formats.

Validate at the boundary. Parse and validate incoming JSON at the edge of your system before it flows into your business logic. JSON Schema is the standard tool for this.

Frequently asked questions about JSON

JSON과 JSON5의 차이는 무엇인가요?

JSON5는 JSON에 주석, 후행 쉼표, 따옴표 없는 키, 작은따옴표 문자열을 추가한 확장입니다. 대부분의 API와 파서는 JSON5가 아닌 엄격한 JSON(RFC 8259)을 기대합니다.

JSON에 바이너리 데이터를 담을 수 있나요?

직접적으로는 안 됩니다. 표준 방식은 바이너리 데이터를 Base64로 인코딩하여 JSON 문자열로 저장하는 것입니다. Base64 Encoder가 이 변환을 처리합니다.

JSON 파일의 최대 크기는 얼마인가요?

JSON 명세에는 크기 제한이 없습니다. 실질적인 제한은 파서의 메모리에 의해 정해집니다. 저희 포매터는 대용량 파일을 브라우저 내에서 효율적으로 처리합니다.

JSON은 JavaScript 객체와 같은 것인가요?

아닙니다. JavaScript 객체는 런타임 데이터 구조입니다. JSON은 텍스트 직렬화 형식입니다. 함수, undefined, 심볼은 유효한 JSON 값이 아닙니다.

프로덕션용으로 JSON을 어떻게 최소화하나요?

JSON Formatter의 Minify 버튼을 사용하세요. 최소화는 모든 공백을 제거하여 일반적인 API 페이로드의 파일 크기를 20–60% 줄여줍니다.