RSS to JSON

Convert RSS to JSON instantly in your browser.

Local Your input is processed locally in your browser. Found a problem? Report an issue

What RSS to JSON does

RSS to JSON reads RSS and writes it as JSON. The input is parsed first, so a syntax error is reported with its position instead of producing broken output.

RSS to JSON examples

The built-in sample

Input

<rss><channel><title>Feed</title><item><title>Post one</title></item></channel></rss>

Output

{
  "title": "Feed",
  "item": {
    "title": "Post one"
  }
}

This is the input that the Load sample button fills in.

A feed with one item, a namespaced element and an enclosure

Input

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Release notes</title><item><title>Version 2</title><dc:creator>Docs team</dc:creator><enclosure url="/audio/v2.mp3" type="audio/mpeg"/><description><![CDATA[<p>Faster parsing</p>]]></description></item></channel></rss>

Output

{
  "title": "Release notes",
  "item": {
    "title": "Version 2",
    "dc:creator": "Docs team",
    "enclosure": {
      "@url": "/audio/v2.mp3",
      "@type": "audio/mpeg"
    },
    "description": "<p>Faster parsing</p>"
  }
}

With a single item, "item" is an object, not an array. dc:creator keeps its prefix, the enclosure attributes get an @ prefix, and the HTML inside CDATA arrives as a plain string.

Each output was produced by running this tool on the input above it.

How it works

Reading RSS. The feed is parsed as XML and the channel element is returned, so the result starts with the feed's title, link and items. Repeated item elements become an array.

Writing JSON. The result is written as JSON with two-space indentation.

Details and limits

  • A channel with exactly one item gives an object for item, and with two or more an array. Code that reads the JSON must handle both.
  • Only RSS is unwrapped. An Atom feed, whose root is feed, is converted like any other XML document and keeps its root key.
  • Dates such as pubDate are left as the text in the feed (RFC 822 format); nothing is parsed or converted.
  • The feed must be pasted in: the tool does not fetch a feed from a URL.
  • Input that is not valid XML stops the tool, and the status line shows where the problem is. The XML Validator page lists the usual causes.

Questions

Does it work with Atom feeds?

An Atom feed is converted like any XML document: the result has a top-level "feed" key with "entry" inside, instead of the unwrapped channel you get for RSS.