XML → YAML
XML to YAML online converter — json-tools.ru
Convert XML to YAML with input validation and readable output.
XML → YAML
Convert XML to YAML with input validation and readable output.
The converter first parses XML into a normalized structure, then renders it as YAML. This is useful when moving data between APIs, configs, logs, and working scripts.
XML is parsed as a tree: elements, attributes, and text nodes are converted to a JSON-like structure before output.
YAML output is convenient for configs, Kubernetes/CI files, and manually reading nested structures.
XML attributes are preserved in @attributes and text values in #text, so important document parts are not lost.
All tools
Quick pages for common tasks: formatting one data type and converting between JSON, YAML, CSV, Python dict and XML.
About
json-tools.ru is built for cases where the data already exists but does not look as clean as it does in docs: a log fragment, an API response, a browser console object, Python repr, Odoo/debug output, YAML or XML. Paste the fragment, and the service detects the format, normalizes the structure and shows the result without manual cleanup.
The service understands JSON-like objects: single quotes, unquoted keys, trailing commas, comments, undefined, Python True/False/None and similar fragments.
The same fragment can be output as JSON, YAML, CSV, Python or XML. For CSV, an object or an array of objects becomes a table, and nested fields are flattened with dot-separated names.
After formatting, you can see the input type, result size, number of keys, objects, arrays, lines and maximum depth. The result can be viewed as code or as a tree.
Added the public API v1: formatting, type detection, JSONPath search, format list, limits and an OpenAPI schema for integrations.
Improved the workspace: result tree with level guides, search navigation, file import and a richer starter example.
Expanded tolerant parsing: JSON-like objects, single quotes, unquoted keys, trailing commas, comments, Python literals, tuple/set and some Odoo repr values.
Added output and analysis formats: YAML, XML, CSV, structure statistics, key sorting, ASCII mode and strict JSON validation.
First service version: JSON formatting and minification in the browser, result copying, basic error handling and a compact interface.
Contact
Write if you found a parsing bug, want to suggest a format, need to clarify API behavior or just want to leave interface feedback.
Email is the main contact channel. It makes it easier to attach sample input, expected output and links to documentation or API requests.
json-tools@yandex.ruThe form does not send data to the server. It only prepares an email body and opens the mail client on your device.
Documentation
Reference for input formats, output settings, search, result tree, file import and the public API. Short, but with the details that matter in real work.
By default, the service chooses the parser automatically. The order is: strict JSON validation, if enabled; XML-looking input; regular JSON; JS-like object; Python repr/dict/list; YAML; then plain text.
Ввод можно оставить в режиме Авто или выбрать JSON, YAML, CSV, Python либо XML. При явном выборе сервис валидирует данные выбранным парсером: например, страница /xml-to-json требует XML на входе и показывает ошибку, если вставлен другой формат.
Common fragments from JavaScript consoles and logs are supported: unquoted keys, single quotes, trailing commas, // and /* */ comments, true/false/null and undefined.
Python dict/list/tuple/set values are converted to JSON-compatible structures. True, False and None become boolean/null. Some values like <Command.SET: 6> are preserved as strings, while datetime.datetime, datetime.date and datetime.time with numeric arguments are converted to readable values.
YAML принимается, если он распознан как объект или массив. XML разбирается отдельно и переводится в JSON-подобную структуру. CSV во входном режиме читается как таблица с заголовками и превращается в массив объектов. Если ни один структурный формат не подошел, ввод считается обычной строкой.
Ввод выбирает парсер исходных данных, Вывод выбирает формат результата: JSON, YAML, CSV, Python или XML. Отступ управляет итоговым кодом: компактно, 2 пробела, 4 пробела или Tab. Кнопка Минифицировать отправляет тот же ввод с отступом 0.
A-Z sorts object keys. ASCII escapes non-ASCII characters where the format supports it. Strict validation disables tolerant parsing and requires valid JSON with double quotes and no extra syntax.
CSV works for an object or an array of objects. Nested objects are expanded into dot-separated columns, for example user.email. Arrays inside cells stay as JSON strings so the structure is not lost.
The result can be viewed as code or as a tree. The tree is useful for nested API responses: it shows levels, arrays, objects and lets you expand only the branches you need. Statistics count size, keys, objects, arrays, depth and lines.
Result search works like editor search: it shows match count and jumps to the current match. You can search plain text, enable regex or use JSONPath. Queries like $.users[*].email, $..email, array indexes and bracketed keys are supported.
You can import a file into the source editor, copy and download source text or result. Editor settings are stored locally: tab size, visible spaces and tabs, line numbers, line wrapping, active line, matching brackets, theme and pane width.
The RU/EN switcher in the top bar opens the language version of the current page. Russian pages are available under /ru/, English pages under /en/.
No. The service sends text for processing and returns a result, but does not store user data. To protect against heavy requests, the input text limit is 1000000 bytes.
API v1 mirrors the main site logic and is intended for integrations: scripts, internal admin tools, CI checks, debug panels and services where data needs to be made readable without opening a browser.
input.mode задает парсер: auto, json, js_like, python, yaml, xml, csv или text. input.strict_json требует строгий JSON. output.format выбирает json, yaml, csv, python или xml. output.indent принимает число 0..8 или строку tab; 0 означает компактный вывод. Также доступны sort_keys, ensure_ascii, include.parsed_data и include.stats.
curl -X POST https://json-tools.ru/api/v1/format \
-H 'Content-Type: application/json' \
-d '{
"source": "{ user: '\''ivan'\'', active: true, }",
"input": { "mode": "auto", "strict_json": false },
"output": { "format": "json", "indent": 2 },
"include": { "stats": true }
}'
The API index is available at /api/, the OpenAPI schema at /api/openapi.json, and the interactive FastAPI documentation at /api/docs. Current limits are available through GET /api/v1/limits.
Public API errors are returned as application/problem+json. Oversized input returns HTTP 413, parse errors and invalid JSONPath return HTTP 422. Input text limit: 1000000 bytes; maximum search results: 500.