XML to JSON Converter
Parse XML into JSON with attribute preservation (@attr) and text nodes (#text). Great for inspecting SOAP responses, RSS feeds, sitemaps, and legacy XML APIs.
工具摘要
此工具接收结构化输入,在浏览器中返回确定性输出,无需上传到服务器。
- 工具名称
- XML to JSON Converter
- 输入意图
- 提供需要转换、校验或分析的原始内容。
- 输出意图
- 获得可直接复制、复用或排错的规范化输出。
- 示例输入
- <book><title>Dune</title><author>Frank Herbert</author><year>1965</year></book>
- 示例输出
- { "book": { "title": "Dune", "author": "Frank Herbert", "year": "1965" } }
Paste XML above and click Convert to JSON.
工具介绍
Parse XML into JSON with attribute preservation (@attr) and text nodes (#text). Great for inspecting SOAP responses, RSS feeds, sitemaps, and legacy XML APIs.
工具概览
The parser reads elements, attributes, text content, and CDATA sections, ignoring XML declarations and comments. Repeated siblings with the same tag name are grouped into a JSON array. Attributes are prefixed with @ and mixed text with #text, so the structure round-trips sensibly. Turn attribute preservation off if you only care about the text content.
使用场景
- Inspect a SOAP response inline without a debugger
- Convert an RSS feed into JSON for your news reader
- Migrate legacy XML fixtures to JSON-based tests
- Pipe an XML sitemap into a URL-auditing script
输入/输出示例
<book><title>Dune</title><author>Frank Herbert</author><year>1965</year></book>
{
"book": {
"title": "Dune",
"author": "Frank Herbert",
"year": "1965"
}
}<book id="42" isbn="0441013597"><title>Dune</title></book>
{
"book": {
"@id": "42",
"@isbn": "0441013597",
"title": "Dune"
}
}<rss version="2.0"><channel><item><title>Hello</title></item><item><title>World</title></item></channel></rss>
{
"rss": {
"@version": "2.0",
"channel": {
"item": [
{ "title": "Hello" },
{ "title": "World" }
]
}
}
}常见问题
Is this XML to JSON converter free?+
What are @ and # prefixes in the output?+
What XML features are supported?+
How are repeated tags handled?+
Can it parse SOAP, RSS, or sitemap XML?+
探索更多工具
在下方的 Data 分类中发现相关工具。
相关工具
精选可能对你有用的实用工具