You have an RSS feed and a tool, script or spreadsheet that would rather speak JSON. Maybe you are auditing what a feed actually publishes, debugging why a reader shows stale posts, or feeding headlines into something you are building. The feed is XML, everything downstream wants JSON, and the gap between the two is small but annoying to cross by hand.
The crossing itself is quick with the free XML to JSON Converter on Ovatly: paste the feed XML, convert, and read the result. The part worth slowing down for is the shape of what comes out, because a feed's structure maps onto JSON in a few specific ways. This guide covers the conversion, how to read the channel and item structure, and the honest limits, including that the tool never fetches the feed for you.
Contents
- Quick answer
- What a feed looks like as JSON
- The item shape caveat
- What does not survive conversion
- How to convert an RSS feed to JSON, step by step
- Worked example: a two item feed
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
To convert an RSS feed from XML to JSON: get the feed's XML in front of you as text, paste it into the XML to JSON Converter, and convert. The <channel> becomes a JSON object, each repeated <item> becomes an entry in an array, attributes such as the version on <rss> become @ prefixed keys, and plain elements like <title> and <link> become strings. The tool never fetches a URL, and namespaces, comments and processing instructions are not carried over into the output.
What a feed looks like as JSON
An RSS feed is a nested document: an <rss> root, one <channel> inside it, channel level fields like <title> and <link>, and then a run of <item> elements, one per post, each with its own title, link and description.
The mapping rules are the same ones the converter applies to any XML. Elements become keys. An element holding only text becomes that text as a string, so the channel title arrives as a plain string. Attributes become keys prefixed with @, which is why the feed's version attribute shows up as @version on the root object. And repeated elements group into arrays, which is the rule that does the heavy lifting for feeds, because items are the repeated element a feed is built from.
The result reads like the feed itself, one level removed: root object, channel object, scalar fields as strings, and the posts as an array of objects under the item key.
The item shape caveat
The array of items exists because the items repeat. That dependence on repetition has a sharp edge: a feed whose channel holds exactly one <item> produces a single item object, not an array containing one object.
For a human reading the output, the difference is obvious at a glance. For code, it is the classic feed bug: a loop that works on every normal feed fails on the brand new blog with a single post, because it tries to iterate over an object. The defence is cheap. After converting, look at the item value before you process it. If it is an array, proceed. If it is a single object, wrap it in an array in your own code and proceed the same way. Shapes vary between documents, so build the check in once and forget it.
What does not survive conversion
Three parts of a feed document are not carried over: namespaces, comments and processing instructions.
Namespaces matter most for feeds. Real world RSS often carries extension elements that live in namespaces, for full article content, media attachments, or podcast data. Those elements will not appear in the JSON. The core feed, channel fields and standard item fields, converts completely, but if the thing you wanted from the feed lives in an extension namespace, this conversion will not give it to you.
Comments and processing instructions are dropped too, which is almost always harmless for a feed, since neither carries post data.
How to convert an RSS feed to JSON, step by step
- Get the feed XML as text. Open the feed in your browser and view the source, save the feed file, or copy the XML from wherever the feed is generated. The XML to JSON Converter never fetches a URL, so this step is yours.
- Paste the whole document into the converter and run it. Parsing uses the browser's built in DOMParser, and nothing leaves your device.
- If the XML is not well formed, the converter reports the problem in plain words. Feeds most often break on an unescaped
&in a title or an unclosed tag; fix it in the pasted text and run again. - Read the output structure: root object,
channelobject, channel fields as strings, anditemas an array, or as a single object if the feed has one post. - Copy the JSON into your tool or script, with the shape check from the caveat above if code will consume it.
Worked example: a two item feed
Here is a small but complete feed fragment, with the standard channel fields and two items:
<rss version="2.0">
<channel>
<title>Example Blog</title>
<link>https://example.com</link>
<item>
<title>First post</title>
<link>https://example.com/first</link>
</item>
<item>
<title>Second post</title>
<link>https://example.com/second</link>
</item>
</channel>
</rss>
Converted, it becomes:
{
"rss": {
"@version": "2.0",
"channel": {
"title": "Example Blog",
"link": "https://example.com",
"item": [
{
"title": "First post",
"link": "https://example.com/first"
},
{
"title": "Second post",
"link": "https://example.com/second"
}
]
}
}
}
Read it against the rules. The version attribute on <rss> is now @version. The channel's <title> and <link> are plain strings. The two <item> elements repeated, so item is an array of two objects, in feed order. Delete one item from the XML and convert again, and that same key holds a single object instead, which is the caveat from earlier in this guide.
Limitations and honest tradeoffs
The tool converts XML you supply; it is not a feed reader. It never fetches a URL, keeps no subscription, and will not notice when the feed updates. Each conversion is a snapshot of the XML you pasted.
Extension content in namespaces is lost, which rules the output out for feeds whose value is in their extensions. Values also arrive as strings throughout, because XML text has no types: a numeric field in an item is a string in the JSON until your code converts it. And a feed that is not well formed converts to nothing, with a plain words error instead of a partial result, so a broken feed has to be repaired at the source or in the pasted copy first.
Common mistakes
- Pasting the feed URL into the converter. It never fetches. Paste the XML text itself.
- Writing a loop that assumes
itemis always an array. A one post feed produces a single object. Check the shape or wrap it. - Expecting extension elements to appear. Namespaced content is not carried over. If the data you need is in an extension, this is the wrong conversion for it.
- Hunting for the version field under a plain key. Attributes carry the
@prefix, so it is@version. - Treating the output as live. It is a snapshot of the moment you pasted. Reconvert when the feed changes.
FAQs
Can the converter fetch my feed from its URL? No. It never fetches a URL. Save or copy the feed XML yourself, paste it in, and the conversion happens in your browser. That also means it works on feeds behind a login, as long as you can see the XML.
Why is item an object instead of an array in my output? Repeated elements become arrays and a single occurrence stays a single value. A feed with one item in its channel produces one item object, not an array of one. Check the shape, or wrap a single object in an array in your own code.
Where did the feed's namespaced elements go? Namespaces are not carried over, and neither are comments or processing instructions. Elements that live in an extension namespace, such as content or media extensions, will not appear in the JSON output.
What happens if my feed XML is broken? The converter parses with the browser's DOMParser and reports well-formedness errors in plain words instead of emitting partial JSON. Fix the XML, usually an unclosed tag or a raw ampersand, and convert again.
Is my feed uploaded to a server? No. The conversion runs fully in your browser using DOMParser, so the feed never leaves your device. You can disconnect after the page loads and the tool still works.
Conclusion
Converting a feed is mostly a reading skill: paste the XML into the XML to JSON Converter, then read the channel object, the item array and the @ prefixed attributes for what they are, knowing that namespaces stay behind and a one item feed changes the shape. If your source is not a feed but ordinary records, the same mapping rules apply, and our companion guide on XML to JSON mistakes with repeated elements and attributes works through them trap by trap. For more guides in this series, see our Data and JSON Tools guides.
References
- RSS Advisory Board, RSS 2.0 specification: https://www.rssboard.org/rss-specification
- MDN Web Docs, on DOMParser and parsing XML in the browser: https://developer.mozilla.org/en-US/docs/Web/API/DOMParser