[{"data":1,"prerenderedAt":199},["ShallowReactive",2],{"tool-content-en-data-converter":3},{"id":4,"title":5,"body":6,"description":189,"extension":190,"locale":191,"meta":192,"navigation":193,"path":194,"seo":195,"stem":196,"toolId":197,"__hash__":198},"tools\u002Ftools\u002Fen\u002Fdata-converter.md","Data Converter - JSON, YAML, TOML & XML",{"type":7,"value":8,"toc":173},"minimark",[9,14,23,27,52,59,63,92,96,127,130,134,137,141,146,149,153,156,160,166,170],[10,11,13],"h2",{"id":12},"what-does-this-data-converter-do","What does this data converter do?",[15,16,17,18,22],"p",{},"This tool translates between the formats that show up most often in\nconfiguration and data interchange: ",[19,20,21],"code",{},".env",", JSON, YAML, TOML, and XML. Paste a\ndocument in any of them, and the tool detects the source format and shows the\nother four as switchable results. You never have to say which format you are\npasting.",[10,24,26],{"id":25},"how-to-use-it","How to use it",[28,29,30,34,46,49],"ol",{},[31,32,33],"li",{},"Paste a document or upload a file. The source format is detected automatically.",[31,35,36,37,41,42,45],{},"The ",[38,39,40],"strong",{},"Source format"," selector above the input defaults to ",[38,43,44],{},"Auto-detect"," and\nshows what was recognized. Change it only when the guess is wrong.",[31,47,48],{},"Every other format appears as a target tab. Open a tab, then copy, download,\nor send the result back to the input.",[31,50,51],{},"Adjust the indentation, key sorting, env prefix, or XML attribute handling as\nneeded.",[15,53,54,55,58],{},"Because the conversion passes through a neutral value model, the result updates\nas you type. JSON is valid YAML and compact ",[19,56,57],{},"KEY=value"," lines are valid TOML, so\nthe detector picks a sensible default and you can always override it.",[10,60,62],{"id":61},"environment-variables","Environment variables",[15,64,65,66,68,69,71,72,75,76,79,80,83,84,87,88,91],{},"A ",[19,67,21],{}," document is a flat list of ",[19,70,57],{}," lines, including ",[19,73,74],{},"export","\nprefixes, single and double quotes, escapes, and multiline quoted values. Nested\nkeys use a double underscore, so ",[19,77,78],{},"{\"database\": {\"host\": \"x\"}}"," round-trips as\n",[19,81,82],{},"DATABASE__HOST=x",". Arrays are stored as JSON strings and null becomes an empty\nvalue. ",[38,85,86],{},"Uppercase keys"," and a ",[38,89,90],{},"key prefix"," can be applied, and comments are\ndropped rather than preserved.",[10,93,95],{"id":94},"format-specific-behavior","Format-specific behavior",[97,98,99,105,111,121],"ul",{},[31,100,101,104],{},[38,102,103],{},"TOML has no null."," A null object entry is dropped from TOML output because\nthere is no way to represent it. A null inside an array is an error, since\ndropping it would change every following index.",[31,106,107,110],{},[38,108,109],{},"TOML and env documents need a table\u002Fobject at the root",", so a root array or\na bare scalar cannot become TOML or env.",[31,112,113,116,117,120],{},[38,114,115],{},"XML attributes"," are represented with a configurable prefix (default ",[19,118,119],{},"@",").\nYou can change the prefix or ignore attributes entirely when reading or\nwriting XML.",[31,122,123,126],{},[38,124,125],{},"Dates"," from TOML are preserved as ISO 8601 strings in JSON and env, and as\nnative timestamps in YAML.",[15,128,129],{},"Errors are per target: if one format cannot represent the data, that tab shows a\nmessage while the others still produce output.",[10,131,133],{"id":132},"privacy-and-security","Privacy and security",[15,135,136],{},"Parsing and serialization run entirely in your browser with JavaScript. Nothing\nis uploaded to a server, no URL parameters are written, and the document is\ndiscarded when you close the page.",[10,138,140],{"id":139},"faq","FAQ",[142,143,145],"h3",{"id":144},"why-did-a-key-disappear-from-my-toml-output","Why did a key disappear from my TOML output?",[15,147,148],{},"That key held a null value. TOML has no null type, so a null object entry is\ndropped rather than converted into a misleading empty string.",[142,150,152],{"id":151},"are-comments-in-a-env-or-yaml-file-preserved","Are comments in a .env or YAML file preserved?",[15,154,155],{},"No. The converter works on the parsed data model, so comments and blank lines\nare not carried over. Use a dedicated formatter when comment fidelity matters.",[142,157,159],{"id":158},"why-was-my-input-detected-as-the-wrong-format","Why was my input detected as the wrong format?",[15,161,162,163,165],{},"JSON is also valid YAML, and compact ",[19,164,57],{}," lines are valid TOML, so more\nthan one parser can accept the same text. The detector picks a default; use the\nSource format selector to pick the format you actually meant.",[142,167,169],{"id":168},"is-there-a-size-limit","Is there a size limit?",[15,171,172],{},"Input is capped at 1 MB, which comfortably covers configuration files while\nkeeping the editor responsive.",{"title":174,"searchDepth":175,"depth":175,"links":176},"",2,[177,178,179,180,181,182],{"id":12,"depth":175,"text":13},{"id":25,"depth":175,"text":26},{"id":61,"depth":175,"text":62},{"id":94,"depth":175,"text":95},{"id":132,"depth":175,"text":133},{"id":139,"depth":175,"text":140,"children":183},[184,186,187,188],{"id":144,"depth":185,"text":145},3,{"id":151,"depth":185,"text":152},{"id":158,"depth":185,"text":159},{"id":168,"depth":185,"text":169},"Paste .env, JSON, YAML, TOML, or XML and convert it to the other formats in your browser. Detect, parse, and format config data with no upload.","md","en",{},true,"\u002Ftools\u002Fen\u002Fdata-converter",{"title":5,"description":189},"tools\u002Fen\u002Fdata-converter","data-converter","wNGI7LaUXNeMtn0GyeeT2YOJv84PqzTDqZ1jcJdBO_M",1792391417143]