RESX to JSON Converter
Convert .resx XML resource files to clean JSON format. Filter keys by regex pattern, preview output, and download or copy the result instantly.
About
RESX files are XML-based resource containers used across .NET ecosystems to store localized strings, metadata, and binary references. Each data node carries a name attribute (the resource key) and a nested value element (the resource content). Manually extracting these pairs into JSON for front-end consumption or API integration is tedious and error-prone. A missed closing tag or mismatched encoding silently corrupts your localization pipeline. This tool parses the raw XML DOM, extracts every data node, and serializes the result as a flat JSON object. It handles xml:space preservation, CDATA content, and empty values without data loss.
Optional regex filtering lets you isolate subsets of keys (e.g., only keys matching PageTitle_.*) before export. This replicates the matchPattern option found in build tools like grunt-resxtojson but requires zero CLI setup. Note: this tool processes the XML structure only. It does not resolve assembly references, embedded binary resources (type System.Byte[]), or .resx designer metadata nodes. Those nodes are skipped by default. Pro tip: if your RESX contains keys with dots (e.g., Form1.Label1.Text), consider post-processing the flat JSON into a nested structure in your build pipeline.
Formulas
The conversion follows a deterministic extraction pipeline from XML DOM to JSON object:
Each data element is filtered through two exclusion rules before key extraction:
When a matchPattern regex is provided, an additional filter is applied:
Where name is the data element's name attribute. The final JSON object is a flat dictionary: { key1: value1, key2: value2, … }. Duplicate keys follow last-write-wins semantics, consistent with .NET's ResourceManager behavior at runtime.
Reference Data
| RESX Element | XML Path | JSON Output | Notes |
|---|---|---|---|
| data (string) | <data name="key"><value>text</value></data> | {"key": "text"} | Standard string resource |
| data with xml:space | <data name="k" xml:space="preserve"> | {"k": " padded "} | Whitespace preserved exactly |
| data with comment | <data><value>v</value><comment>c</comment></data> | {"key": "v"} | Comments are discarded |
| Empty value | <data name="k"><value/></data> | {"k": ""} | Empty string preserved |
| CDATA value | <value><![CDATA[html]]></value> | {"k": "html"} | CDATA unwrapped to text |
| Multiline value | <value>line1\nline2</value> | {"k": "line1\nline2"} | Newlines in JSON string |
| resheader | <resheader name="resmimetype"> | Skipped | Metadata, not a resource |
| assembly | <assembly alias="..."> | Skipped | Assembly reference only |
| data with type | <data name="k" type="System.Byte[]"> | Skipped | Binary resource, not text |
| data with mimetype | <data name="k" mimetype="..."> | Skipped | Embedded object reference |
| Duplicate keys | Two <data name="k"> | Last value wins | Matches .NET runtime behavior |
| Special characters | & < > | {"k": "& < >"} | XML entities decoded |
| Unicode content | <value>日本語</value> | {"k": "日本語"} | UTF-8 preserved |
| Namespaced root | <root xmlns="..."> | Parsed normally | Namespace ignored for traversal |
| Schema declarations | <xsd:schema> | Skipped | XSD definitions ignored |