[{"data":1,"prerenderedAt":219},["ShallowReactive",2],{"page-en":3,"article-list-en":127,"article-en-fix-invalid-json-before-yaml":153},{"id":4,"title":5,"body":6,"description":17,"extension":18,"faqLabel":19,"faqTitle":20,"faqs":21,"footerFree":40,"footerLocal":41,"footerNavigate":42,"footerOutput":43,"footerTagline":44,"intro":45,"kicker":46,"limits":47,"limitsIntro":60,"limitsLabel":61,"limitsTitle":62,"mappingIntro":63,"mappingLabel":64,"mappingNoteLabel":65,"mappingTitle":66,"mappings":67,"meta":92,"navigation":93,"notes":94,"notesLabel":104,"notesTitle":105,"path":106,"seo":107,"seoTitle":108,"stem":109,"useCases":110,"useCasesIntro":123,"useCasesLabel":124,"useCasesTitle":125,"__hash__":126},"pages\u002Findex.md","JSON to YAML Converter",{"type":7,"value":8,"toc":13},"minimark",[9],[10,11,12],"p",{},"Generate readable YAML from valid JSON while keeping the conversion inside the current browser tab.",{"title":14,"searchDepth":15,"depth":15,"links":16},"",2,[],"Convert valid JSON to readable YAML in your browser. Choose indentation and line width, then copy or download the YAML without uploading your data.","md","FAQ \u002F 03","Before you generate a YAML file",[22,25,28,31,34,37],{"question":23,"answer":24},"Is the JSON sent to a server?","No. JSON parsing and YAML generation run in the browser, and local files are read with the File API.",{"question":26,"answer":27},"Does YAML preserve JSON data types?","Strings, numbers, booleans, null, arrays, and objects are represented in YAML. Consumers can still apply their own YAML schemas when loading the result.",{"question":29,"answer":30},"Can I choose indentation?","Yes. The converter supports two or four spaces and selectable line wrapping.",{"question":32,"answer":33},"Why did the output order stay the same?","JavaScript object traversal normally retains JSON insertion order, and the converter does not alphabetically reorder keys.",{"question":35,"answer":36},"Will the converter add YAML comments or anchors?","No. JSON has no comments, anchors, aliases, or custom tags, so the converter cannot infer them. The output is deliberately standard, readable YAML.",{"question":38,"answer":39},"Is JSON to YAML conversion reversible?","Supported data values can usually be converted back, but formatting choices are not reversible. Quotes, whitespace, line wrapping, and comments will not reproduce the original source.","Free to use","No server storage","Navigate","Output","A browser-local converter for readable configuration output.","Transform strict JSON into YAML that is easier to review, edit, and place in configuration files.","CONFIG, WITHOUT THE BRACES",[48,51,54,57],{"title":49,"body":50},"Comments cannot be generated","JSON contains no comment tokens, so a converter has no reliable source for explanatory YAML comments. Add human notes after conversion when the file needs them.",{"title":52,"body":53},"Duplicate keys are already gone","A parsed JSON object cannot preserve duplicate property names as separate values. Validate the source before relying on the converted file.",{"title":55,"body":56},"Large numbers may lose precision","JSON numbers are parsed using JavaScript numeric behavior. Quote identifiers and precision-sensitive integers in the source when they are intended as text.",{"title":58,"body":59},"Round trips change formatting","Converting JSON to YAML and back should preserve supported values, but whitespace, quoting style, line wrapping, and object formatting will not be identical.","The generated YAML represents the parsed JSON value, not the exact source text. These boundaries matter when the file will be committed as configuration or passed to another parser.","ROUND-TRIP NOTES \u002F 04","Readable output still deserves a review","JSON has a compact, predictable type system. YAML can express the same objects, arrays, strings, numbers, booleans, and null values with less punctuation.","TYPE MAPPING \u002F 03","Result","From JSON values to readable YAML",[68,72,76,80,84,88],{"json":69,"yaml":70,"note":71},"\"name\": \"Ada\"","name: Ada","Safe strings may be written without quotes. The serializer adds quotes when a plain scalar could be misunderstood.",{"json":73,"yaml":74,"note":75},"\"enabled\": true","enabled: true","JSON booleans remain booleans and use lowercase true or false in the YAML output.",{"json":77,"yaml":78,"note":79},"\"count\": 42","count: 42","JSON numbers remain numeric. Very large values have already passed through JavaScript number parsing.",{"json":81,"yaml":82,"note":83},"\"items\": [\"a\", \"b\"]","items:\n  - a\n  - b","Arrays become YAML sequences. Their order is preserved and nested arrays receive additional indentation.",{"json":85,"yaml":86,"note":87},"\"value\": null","value: null","JSON null remains an explicit YAML null so it is not confused with a missing key.",{"json":89,"yaml":90,"note":91},"\"meta\": {\"id\": 7}","meta:\n  id: 7","Objects become YAML mappings. Property traversal normally retains insertion order, but order is not JSON semantics.",{},true,[95,98,101],{"title":96,"body":97},"JSON must be valid first","Comments, trailing commas, undefined, and JavaScript object literals are rejected instead of silently repaired.",{"title":99,"body":100},"Formatting is intentionally selectable","Two or four spaces and practical line-width choices cover common YAML style conventions without turning the tool into an IDE.",{"title":102,"body":103},"Some information cannot transfer","JSON has no comments, anchors, custom tags, or original YAML formatting, so the converter cannot invent or restore them.","CONVERSION NOTES \u002F 02","What changes when braces become indentation","\u002F",{"title":5,"description":17},"JSON to YAML Converter — Create Clean YAML Online","index",[111,115,119],{"title":112,"body":113,"code":114},"Application configuration","Move generated JSON settings into a YAML-first application, CLI, or service configuration.","app.yaml",{"title":116,"body":117,"code":118},"CI and deployment files","Start from machine-generated JSON and create a readable base for pipelines or deployment manifests.","pipeline.yml",{"title":120,"body":121,"code":122},"Fixtures and documentation","Present nested example data in a compact format that is easier for people to scan and annotate.","example.yaml","JSON is excellent for machines. YAML is often easier to maintain when configuration becomes a shared human artifact.","USE CASES \u002F 01","Where generated YAML earns its place","vyVqS7TQxaYQ6516jvM4bja5kyWtQNdh5ipu2P6fq0o",[128,133,138,143,148],{"slug":129,"title":130,"description":131,"eyebrow":132},"fix-invalid-json-before-yaml","Fix invalid JSON before converting it to YAML","Diagnose common JSON syntax errors including trailing commas, single quotes, comments, and malformed strings before YAML conversion.","ERROR GUIDE",{"slug":134,"title":135,"description":136,"eyebrow":137},"json-to-yaml-configuration","Convert JSON configuration files to readable YAML","A practical workflow for converting JSON configuration to YAML while preserving structure, types, and deployment intent.","CONFIGURATION WORKFLOW",{"slug":139,"title":140,"description":141,"eyebrow":142},"json-vs-yaml","JSON vs YAML: syntax, readability, and conversion trade-offs","Compare JSON and YAML syntax, data types, comments, indentation, and the trade-offs involved when converting structured data.","FORMAT COMPARISON",{"slug":144,"title":145,"description":146,"eyebrow":147},"preserve-json-types-in-yaml","Preserve JSON data types when converting to YAML","Learn how strings, numbers, booleans, null, arrays, and objects map from JSON to YAML without accidental type changes.","TYPE SAFETY",{"slug":149,"title":150,"description":151,"eyebrow":152},"yaml-indentation-and-line-width","YAML indentation and line width after JSON conversion","Choose readable YAML indentation and line-width settings after converting JSON objects and arrays.","OUTPUT FORMATTING",{"id":154,"title":130,"body":155,"description":131,"extension":18,"eyebrow":132,"faqs":159,"intro":169,"meta":170,"navigation":93,"path":171,"relatedGuides":172,"sections":173,"seo":213,"seoTitle":214,"slug":129,"stem":215,"type":216,"updated":217,"__hash__":218},"articles\u002Fen\u002Farticles\u002Ffix-invalid-json-before-yaml.md",{"type":7,"value":156,"toc":157},[],{"title":14,"searchDepth":15,"depth":15,"links":158},[],[160,163,166],{"question":161,"answer":162},"Does working with invalid JSON before YAML conversion change the underlying data?","It should not change meaning when the operation is purely representational, but parsers may resolve aliases, normalize numbers, drop comments, or choose a different textual style. Compare parsed structures and review the destination’s rules.",{"question":164,"answer":165},"How can I verify the result?","Parse both sides where possible, compare keys and value types, then test the generated result in its real consumer. A visual comparison alone can miss null, number, Boolean, encoding, or duplicate-key differences.",{"question":167,"answer":168},"When should I avoid an automatic conversion?","Avoid unattended conversion when the source uses implementation-specific features, duplicate keys, custom tags, comments that carry operational knowledge, or numeric values whose precision cannot be safely represented.","Conversion begins with strict JSON parsing. Fixing the first reported syntax error often reveals the next issue, so work from the top of the document downward.",{},"\u002Fen\u002Farticles\u002Ffix-invalid-json-before-yaml",[134,139,144],[174,179,183,187,196,202,207],{"title":175,"paragraphs":176,"code":178},"Common invalid JSON patterns",[177],"JSON requires double-quoted keys and strings. It does not permit comments, trailing commas, undefined, NaN, or JavaScript object syntax.","{\n  \"name\": \"demo\",\n  \"enabled\": true,\n}",{"title":180,"paragraphs":181},"Read the parser position",[182],"The line and column usually point near the unexpected token. Check the preceding comma, quote, bracket, or brace because the real cause can be immediately before the reported position.",{"title":184,"paragraphs":185},"Validate before trusting the YAML",[186],"Do not silently repair unknown source data. Correct the JSON deliberately, validate it, then convert and compare the resulting structure.",{"title":188,"paragraphs":189,"bullets":192},"A reliable step-by-step workflow",[190,191],"Treat invalid JSON before YAML conversion as a data transformation with an explicit input, expected structure, and destination. Work on a copy, validate before changing representation, and isolate the smallest useful sample. This separates syntax failures from data-model or application failures.","Run one change at a time and repeat the same validation after each change. For automated pipelines, fail the job on a parser error instead of publishing a partial or guessed result. Keep the original input beside the generated artifact when traceability matters.",[193,194,195],"Fix the first reported error before later ones; one missing quote can create many secondary messages.","Reduce a large document to the smallest failing fragment while preserving the nesting around the error.","After syntax succeeds, verify required keys, value types, ranges, and application-specific rules.",{"title":197,"paragraphs":198,"code":201},"Worked example and verification",[199,200],"The compact sample below is intentionally small enough to inspect by eye. Use the same pattern with a real document: confirm every key, scalar type, list order, and nested boundary before accepting the output.","A successful conversion or minification only proves that the source could be parsed. Compare the parsed value before and after the operation, then load the result with the same library or platform that will consume it in production.","{\n  \"service\": \"api\",\n  \"ports\": [8080, 8443]\n}",{"title":203,"paragraphs":204},"Limits and edge cases",[205,206],"The difficult cases in invalid JSON before YAML conversion usually come from differences between syntax validity and application validity. A parser can accept data that is still incomplete, ambiguous, too large, or incompatible with a destination schema.","Never repair or normalize an unfamiliar document blindly. Duplicate keys, implicit types, aliases, precision limits, Unicode, line endings, and very large inputs deserve an explicit policy. When the destination has stricter rules, those rules win.",{"title":208,"paragraphs":209,"bullets":212},"Production checklist",[210,211],"Before release, test a normal document, an empty value, deeply nested data, non-ASCII text, and a deliberately malformed example. Record the tool or library version if another system must reproduce the exact output.","Make validation part of continuous integration when the data affects builds, deployments, APIs, or configuration. Review diffs, keep a rollback copy, and monitor the first consumer after deployment rather than assuming a syntactically valid file is operationally correct.",[193,194,195],{"title":130,"description":131},"Fix Invalid JSON Before Converting to YAML","en\u002Farticles\u002Ffix-invalid-json-before-yaml","guide",null,"CySNC890obcNeXAj4JvqMlfp_fsEjZstAt42PA60zIQ",1791974046800]