How to convert an XML file and review its JSON
Select one .xml document and run the conversion
Save the actual XML document to your device, then choose it in the tool above and select Convert to JSON. The preview appears after the conversion succeeds. Download the new .json file to use in code, a data pipeline, or a text editor. This workspace handles one file at a time, so choose another file after saving the first result. It accepts files up to 15 MB; the generated output also has a 15 MB limit.
A browser preview shows only the beginning of a large result. Do not mistake a truncated preview for a truncated download. Open the downloaded file in a JSON editor and check the root key, the fields you need, and the array shape before updating an application that consumes it. If you are starting with another kind of data file, the data tools directory on the home page links to the relevant converter rather than forcing that data through XML.
Use a small sample to establish the mapping
Consider an inventory document with two item elements beneath a catalog root. The output has a catalog property, then an item array because the same element name occurs twice. A single item with that name may instead appear as an object, not a one-element array. Test both one-record and many-record examples if downstream code expects an array every time. This tool follows the source shape; it does not enforce a schema or normalize all possibly repeated fields into arrays.
After conversion, the browser produces formatted JSON with indentation for reading. Pretty printing changes whitespace in the output file, not the meaning of the JSON values. It also means the saved JSON can be larger than compact XML or a minified JSON representation. Check the output size when moving large feeds into a service that has its own payload limit.
Why XML elements and JSON properties do not line up perfectly
Attributes become keys starting with @
An XML element such as an item with an id attribute and a nested price has two distinct kinds of information: the id is an attribute, while price is a child element. This converter keeps the attribute as an @id property and the child as a price property. The prefix is a conversion convention, not a literal @ in your original attribute name. If your application expects id without a prefix, change the downstream mapping deliberately instead of assuming that attribute and child names were merged.
When an element has both a text value and attributes, its result may be an object containing a #text property alongside @ properties. Code that expects every leaf to be a plain string can therefore fail on an apparently simple XML document. Inspect at least one element with attributes and one without them before writing property access such as product.price. The output is a parsed representation rather than a reversible, byte-for-byte copy of the input.
Repeated children become arrays; one child may stay scalar
XML permits any number of sibling elements with the same name. JSON objects need a single property per name, so the parser groups repeated siblings under an array. For example, two tag children become tag: [value1, value2], while a single tag may become tag: value1. This common shape change is why a successful conversion can still require a small adjustment in application code. Check actual data, not just a simplified example from a documentation page.
Empty elements also need review. A self-closing tag can become an empty string in the output, while a missing tag does not create a property at all. Empty string, absent property, null, and an empty array mean different things to a JSON consumer. If an API requires one exact form, validate and transform the downloaded JSON before sending it to that API. The converter does not infer your schema's meaning for an empty XML element.
How text, numbers, and namespaces affect the output
Text stays text, including values that look numeric
The parser keeps tag values as strings rather than guessing numbers or booleans. Thus 001 remains text and does not silently turn into 1; true is also a string until your own code converts it. This matters for postal codes, product identifiers, account numbers, and values with leading zeros. XML attribute values are text too. If your destination system requires numeric JSON values, apply its schema after conversion and handle invalid values explicitly.
Whitespace around a simple text value is trimmed. That is helpful for many data exports, but it means this operation is not appropriate for preserving exact XML typography or signed document bytes. In mixed content, where prose and child tags alternate, the parser can place surrounding prose into #text and lose the original spacing between fragments. For document-like XML, inspect a representative paragraph carefully; this tool is best suited to data-oriented XML.
Namespace prefixes remain visible in keys
A namespaced element such as ns:entry keeps the prefix in its JSON property name, while the namespace declaration may appear as an @xmlns:ns attribute. The tool does not translate every qualified name into a full namespace URI or merge equivalent prefixes. Two XML files can use different prefixes for the same namespace and produce different key names. If you are combining feeds from separate producers, normalize namespaces in a later step with rules from the source specification.
XML declarations and other special nodes can also appear in the parsed object. A declaration carrying a version value may be represented by a ?xml key. Do not assume the first top-level key is always the business root without checking the exported JSON. Identify the actual element your application needs and disregard declaration data only when it is safe for that workflow.
What changes when XML is turned into JSON
Structure and bytes change even when the data looks similar
XML distinguishes attributes, child elements, text nodes, namespaces, and ordering. JSON distinguishes objects, arrays, strings, numbers, booleans, and null. A converter must choose a mapping across these different models, and another converter might choose a different one. This page's @ keys, #text fields, and arrays describe this tool's choices; they are not a universal XML-to-JSON standard. Store the original document when exact reconstruction matters.
The downloaded JSON is an ordinary text file. It does not include a hidden XML copy or a record of every formatting choice from the source. XML comments, indentation, and the lexical form of entities are not a reliable part of the converted business data. If a client sends you signed XML, do not expect a JSON export to verify as the same document. Use the original signed XML in any workflow that depends on its original bytes.
JSON can be easier to inspect but is not automatically tabular
A nested order document can contain a customer, several line items, addresses, and optional notes. The JSON export preserves a nested view of those parts; it does not flatten them into spreadsheet columns. To make a CSV, first decide which objects represent rows and how to handle repeating or nested fields. The json to csv tool works with an array of records, so a root object produced from XML may need deliberate reshaping before that next conversion.
For a workbook, the json to excel page has the same record-array requirement. A successful XML conversion alone does not make the JSON ready for either tabular tool. Keep these steps separate so a missing column or duplicated child does not get hidden inside a later spreadsheet export.
What to check when XML validation or parsing fails
Fix the source syntax, then retry the same file
The tool validates XML before building JSON. One unclosed tag, a mismatched closing name, or an unescaped ampersand in text can stop the entire conversion. Open the source in a text editor and look near the location reported by your XML editor, if available. A literal ampersand in XML text generally needs to be written as & in the source file. Also check that you saved XML rather than a web error page whose filename happens to end in .xml.
The converter shows a general message when the file is not well formed. It is not a schema validator and does not prove that a document satisfies an XSD or a partner's business rules. A well-formed invoice can still have the wrong field names or missing required information. Validate against the intended recipient's schema separately, ideally before sending its JSON representation onward.
Investigate unexpected arrays, values, or missing text
If an expected field appears as an array, search the source for repeated siblings with that exact name. If a number looks like a string, that is the intended behavior here; parse it in your application only after validating the content. If a paragraph loses spacing, check whether it mixes plain text with nested tags. In each case the most useful comparison is between one source element and its matching JSON property, rather than a line-by-line comparison of two different formats.
For a file close to the 15 MB limit, the formatted output can exceed the permitted output size. Split a feed into meaningful source documents or use a parser in your own environment that can stream data. Refreshing this page will not raise the limit. Files are processed in the browser, so closing the tab also discards the selected input and preview; save your download before leaving.