🛠️DevTools

RSS Feed to JSON

RSS feed XML converts to a structured JSON object, making it easy to process feed items programmatically.

Switch tool:
Examples:
JSON output will appear here...

💡 Paste your XML and it converts to JSON automatically. Attributes are prefixed with @ and text content uses #text.

Code Examples

Here's how to achieve this in different programming languages:

1// Using DOMParser (browser) or xml2js (Node.js)
2const xmlString = `<rss version="2.0">
3 <channel>
4 <title>My Blog</title>
5 <item>
6 <title>First Post</title>
7 <link>https://example.com/1</link>
8 </item>
9 </channel>
10</rss>`;
11
12// Browser
13const parser = new DOMParser();
14const doc = parser.parseFromString(xmlString, 'text/xml');
15
16// Node.js with xml2js (npm install xml2js)
17const xml2js = require('xml2js');
18const parser = new xml2js.Parser();
19parser.parseString(xmlString, (err, result) => {
20 console.log(JSON.stringify(result, null, 2));
21});
22
23// Output:
24// {
25// "rss": {
26// "@version": "2.0",
27// "channel": {
28// "title": "My Blog",...

More XML Examples

Related XML Tools

📚 Learn More