Dev · 108 tools · nothing uploads

YAML ↔ JSON

Convert between YAML and JSON. Runs on your device.

Input

Options

live

YAML <-> JSON runs the js-yaml library in either direction from one mode toggle, turning a YAML file into JSON or a JSON value back into YAML. Invalid YAML or JSON gets refused with that parser's own error message. YAML's own coercions, an unquoted yes reading as true or a bare number reading as a number, apply exactly as js-yaml defines them.

Questions

What library does the conversion?

js-yaml, imported lazily inside the run.

What YAML type coercions apply?

Whatever js-yaml itself defines, an unquoted yes becoming true or a bare number becoming a number, not a custom rule this tool adds.

What happens with invalid YAML?

The tool refuses with js-yaml's own parser error message.

What happens with invalid JSON?

The tool refuses with JSON.parse's own error message.

Does it preserve comments?

No, YAML comments are not represented in JSON, so converting to JSON and back loses them.

Related Dev tools

n→nCBOR to JSON converterEncode JSON to CBOR bytes (shown as hex) or decode CBOR bytes back to JSON. Covers uint/negint/text/array/map/float/bool/null; no byte strings, tags, or indefinite-length items.Runs on each file you dropn→nJSON ↔ MessagePackEncode JSON to MessagePack bytes (shown as hex) or decode MessagePack bytes back to JSON. Covers nil/bool/int/float64/str/array/map: no bin, ext, or timestamp extension types.Runs on each file you dropn→nJSON ↔ RisonConvert JSON to Rison (the compact URI-safe notation Kibana/Elasticsearch use for query params) and back. This tool's own encoder/decoder for the documented core grammar (no reference implementation in this codebase to check against). Exotic edge cases like embedded control characters or surrogate-pair characters are not guaranteed byte-identical to the reference grammar.Runs on each file you dropn→nPHP serialize / unserializeConvert JSON to PHP's serialize() format and back. Covers null/bool/int/float/string/array. PHP objects (O:) are not implemented since they need a class registry this tool doesn't have.Runs on each file you dropn→nPLIST viewerView an XML property list (.plist) as JSON. Binary plist (bplist00) is not supported. It needs a separate binary-format parser this tool does not implement.Runs on each file you dropn→nGeoJSON ↔ CSVConvert GeoJSON Point features to CSV rows and back. LineString/Polygon geometries export as a flattened coordinate list (one-way; CSV->GeoJSON always builds Points). CSV parsing is fully quote-aware, so a quoted field holding a comma or a newline no longer shifts the coordinate columns.Runs on each file you dropn→nKML/GPX to GeoJSONConvert a GPX (waypoints/tracks/routes) or KML (Placemarks: Point/LineString/Polygon) file to GeoJSON. A hand-rolled tag scan, not a general XML parser: no styles, nested Folder hierarchy, MultiGeometry, or extended data.Runs on each file you drop·→1Coordinate format convert (DD/DMS/UTM)Convert between decimal degrees, degrees-minutes-seconds, and UTM. WGS84, standard 6° zones, non-polar only. MGRS grid-square lettering is not implemented (its edge cases are a separate, riskier piece of work).Takes no file