JSON ↔ YAML Converter

JSON ↔ YAML Converter

Convert a JSON value or one YAML 1.2 document in either direction. Detect duplicate keys, aliases, unsupported tags and numeric precision loss, with 2- or 4-space indentation.

Input and results are processed in browser memory; this tool does not upload or store them. Reloading clears them. Site-wide advertising and analytics may operate separately, but tool usage events do not contain your input or output.

Comments & questions

JSON ↔ YAML Converter

Convert configuration examples and structured data between JSON and YAML 1.2. Objects, arrays, strings, booleans, null and safely represented numbers are supported. This is not a comment-preserving YAML editor: unsupported structures and numbers produce errors instead of silently changing their meaning.

Key features

  • Convert JSON to YAML or YAML to JSON
  • Choose 2- or 4-space indentation for nested objects and arrays
  • Reject duplicate keys, multiple documents, aliases and non-string keys
  • Detect unsafe integers, decimal rounding and numeric underflow

How to use

  1. Choose a conversion direction and indentation width.
  2. Enter one JSON value or one YAML 1.2 document. Try the example to see the supported format.
  3. Run the conversion and inspect the result or error. Quote large identifiers as strings.
  4. Copy the result and separately validate any application-specific configuration rules.

Use cases

  • Include API response examples in YAML documentation
  • Review JSON configuration as YAML
  • Check that identifier strings and boolean values keep their intended types

Frequently asked questions

Can I convert several YAML documents at once?

No. A stream containing multiple documents separated by --- produces an error. The tool will not convert only the first document and silently discard the rest.

Are comments, anchors and aliases preserved?

Comments, original quote styles, spacing and anchor names are not retained. Aliases that reference other values are rejected rather than expanded. YAML 1.1 merge-key behavior is not supported.

Why are some numbers rejected?

Numbers outside JavaScript’s safe integer range, or decimal values that change when parsed and printed, are rejected. Infinity, NaN and negative zero are also unsupported. Quote precise identifiers or decimal amounts when they must be treated as strings.

How are yes, dates and numeric keys handled?

Under YAML 1.2 Core rules, yes and ordinary date notation are strings. Mapping keys interpreted as numbers or booleans are rejected; quote them to make string keys. Custom tags are not supported.

Does JSON accept comments or duplicate keys?

No. JSON syntax validation excludes comments and trailing commas, and duplicate keys are rejected to avoid keeping only the last value. Scalar, array and object root values are supported.

What are the limits and validation scope?

Input is limited to 100,000 UTF-16 code units, 10,000 nodes and 100 nesting levels. This converts data formats; it does not validate Kubernetes or other application-specific schemas.

Privacy

Input and results are processed in browser memory; this tool does not upload or store them. Reloading clears them. Site-wide advertising and analytics may operate separately, but tool usage events do not contain your input or output.

References

Related Tools

JSON FormatterXML ↔ JSON ConverterJSON ↔ CSVWasm Module InspectorHreflang Matrix CheckerAST Query PlaygroundContainer Build GraphDependency Graph ExplorerSemver Range LabCron Schedule AuditorPatch Review WorkbenchSource Map ExplorerLocalization Catalog AuditorStructured Data ReviewerHTTP Archive AnalyzerWebhook Signature LabProtobuf Schema WorkbenchGraphQL Schema LabAvro Schema EvolutionLocal SQL WorkbenchSchema Form BuilderMesh Repair WorkbenchPipe Network LabRobot Arm Kinematics LabThermal Network LabBeam Response LabGear Train DesignerTolerance Stackup LabSensor Calibration FitPCB Stackup PlannerDigital Filter DesignerNetwork Reachability MapSun Shadow MapGPS Error SimulatorDigital Logic SimulatorAnalog Circuit LabMechanism Linkage LabAnalysis Mesh GeneratorOpenAPI Contract InspectorDatabase Migration PlannerDimensional Equation CheckerTruss Force LabBoolean Minimization LabControl Response LabQueueing Simulation LabGeofence Event SimulatorCoordinate Reference LabSurvey Traverse LabRaster Classification LabChoropleth Design LabMap Print ComposerRaster Reprojection LabElevation Contour MakerTerrain Viewshed LabWatershed DelineatorMap Tile PackagerText File Encoding WorkbenchFilesystem Portability AuditorSBOM License ExplorerFile Signature Auditornpm Lockfile Conflict ResolverSource Secret AuditorOffline Web Package BuilderCertificate Chain InspectorTorrent Metainfo InspectorChunked File PackagerEncrypted File VaultDuplicate File FinderArchive WorkbenchDesign Token ManagerSpacing Token DesignerResponsive Type SystemPackaging Dieline DesignerSVG Icon Sprite PackerFlex Layout PlaygroundCSS Grid PlaygroundRegex Equivalence LabMarkdown Repository AuditorLog Template MinerResponsive Layout AuditorEmail Template PreviewInternal Link GraphState Machine TesterPetri Net SimulatorGit History VisualizerCurl Request WorkbenchBinary Protocol DesignerHex File EditorBinary Patch WorkbenchFile Signature WorkbenchAPI Mock SandboxSchema Column MapperEvent Log SessionizerER Diagram DesignerTime Series Gap AuditorStratified Data SplitterData Lineage DesignerDecision Tree LabData Anonymization WorkbenchData Expectation RunnerJSON Schema ValidatorBasket Pattern AnalyzerRobots Policy TesterSEO HTML AuditorAccessibility Structure AuditorSyndication Feed WorkbenchIndexNow Payload BuilderCrawl Log AnalyzerCSP Policy WorkbenchSearch Performance AnalyzerCSV Formula Risk AuditorCORS Response SimulatorCache Header LabCookie Policy InspectorWeb Vitals Trace LabSitemap Health AuditorBatch File RenamerFile Manifest VerifierFolder Space MapFolder Difference ReviewerRoute Order OptimizerGeoJSON Map EditorPolygon Overlay LabCartographic Label PlacerSpatial Table JoinGeoJSON Topology AuditorGPX Track AnalyzerTrack Privacy RedactorCSV Table JoinCSV Pivot WorkbenchScientific Data ProfilerTabular Cleaning WorkbenchRecord ReconciliationData Dictionary BuilderCanonical Graph AuditorRedirect Plan TesterHTTP response and ping reference testBrowser and System InformationHTML FormatterJavaScript MinifierMock Data Generator.gitignore GeneratorLicense GeneratorUser-Agent ParserPassword Strength CheckerCode to ImageXML FormatterHTTP Status Code LookupMIME Type LookupJS & SQL String EscapeCSS Box Shadow GeneratorCSS Gradient GeneratorIndent ConverterNumber Base ConverterUnicode Escape ConverterUnicode InspectorJSON Structure DiffMarkdown Table GeneratorBase64 EncoderURL EncoderSQL FormatterCron Expression GeneratorRegex TesterUUID GeneratorHash GeneratorTimestamp ConverterJWT DecoderHTML Entity ConverterMarkdown PreviewCSS MinifierMeta Tag GeneratorCase ConverterImage to Base64
Explore all Dev Tools tools →Image/Media →Text/Convert →Life/Fun →