How to convert YAML and JSON
Pick a direction — YAML → JSON or JSON → YAML — paste your document into the input pane, and the converted result appears on the right as you type. Choose 2-space, 4-space or tab indentation for the output, copy the result with one click, or press Use output as input to chain conversions and round-trip a document. If the input has a syntax error, the status line reports exactly what went wrong instead of producing a broken result. Everything runs in your browser; nothing is uploaded.
Why convert between YAML and JSON at all?
YAML and JSON describe the same data model — maps, sequences and scalars — but serve different audiences. JSON is compact, unambiguous and the lingua franca of APIs and machine-to-machine exchange. YAML is designed for humans: indentation instead of braces, comments, and less punctuation, which is why it dominates Kubernetes manifests, GitHub Actions and GitLab CI pipelines, Ansible playbooks and Docker Compose files. Converting between them is a daily need: you copy a JSON API response and want it as readable YAML, or you have a hand-written YAML config and need strict JSON to feed a program or validate against a schema. This tool makes that round-trip instant and lossless for data and structure.
Multi-document streams and type fidelity
A single YAML file can hold multiple documents separated by ---, a pattern Kubernetes uses constantly to bundle a Deployment, Service and ConfigMap together. When you convert such a stream to JSON, this tool produces a JSON array with one element per document, so nothing is lost. Scalar types are preserved in both directions: true stays a boolean, 42 stays a number, null stays null, and quoted values stay strings — avoiding the classic YAML pitfalls where an unquoted no or version number is misread. Going from JSON to YAML, the converter emits clean block-style YAML with your chosen indentation and no line-wrapping surprises.
Safe loading by design
YAML is more powerful than JSON, and that power has a sharp edge: the full specification allows custom tags that can represent arbitrary, even executable, types. A naive parser can be tricked by a malicious document. This converter uses safe loading, which restricts parsing to the standard data types — maps, sequences, strings, numbers, booleans and null — and rejects custom tags outright. You get faithful data conversion without exposing yourself to the deserialization risks that have produced real-world vulnerabilities in YAML tooling.
Why a local converter matters
The YAML files developers convert are rarely trivial. Kubernetes secrets, CI pipeline definitions with deploy tokens, environment manifests, infrastructure-as-code — these routinely contain credentials and internal hostnames. Pasting them into an online converter or a chatbot to "just get the JSON" leaks exactly the material you are paid to protect. This tool eliminates the risk: the bundled YAML engine runs as JavaScript in your own tab, with no network request and no logging. Close the tab and everything you pasted is gone.
That is the gitime.dev approach across the board — deterministic, dependency-light tools that keep your data on your machine. A format conversion never needs to leave your browser to happen.
- Two-way conversion: YAML → JSON and JSON → YAML.
- Multi-document YAML streams become a JSON array.
- Type-safe: booleans, numbers, null and strings preserved.
- Configurable 2-space, 4-space or tab indentation.
- Everything stays on your device — no upload, no logging.
Frequently asked questions
- Is my YAML or JSON uploaded anywhere?
- No. Conversion runs in your browser with a bundled copy of js-yaml. Nothing is transmitted.
- Can it convert multi-document YAML?
- Yes. Documents separated by
---become a JSON array, one element each. - Is loading YAML safe?
- Yes. Safe loading rejects custom tags that could represent executable types.
- Does it preserve comments?
- No. JSON has no comments, so they are dropped; data and types are preserved.