{"id":15030413,"url":"https://github.com/naturalintelligence/fast-xml-parser","last_synced_at":"2026-02-25T07:55:10.357Z","repository":{"id":37334316,"uuid":"80317682","full_name":"NaturalIntelligence/fast-xml-parser","owner":"NaturalIntelligence","description":"Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.","archived":false,"fork":false,"pushed_at":"2025-05-11T12:20:40.000Z","size":7785,"stargazers_count":2765,"open_issues_count":58,"forks_count":323,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-12T04:04:02.338Z","etag":null,"topics":["cli","command-line","fast","fast-xml-parser","js","js2xml","json","json2xml","locale","parser","rapid","validate","validator","xml","xml2js","xml2json","xml2nimn"],"latest_commit_sha":null,"homepage":"https://naturalintelligence.github.io/fast-xml-parser/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NaturalIntelligence.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"NaturalIntelligence","open_collective":"fast-xml-parser","custom":["https://paypal.me/naturalintelligence"]}},"created_at":"2017-01-28T23:25:42.000Z","updated_at":"2025-05-11T12:20:44.000Z","dependencies_parsed_at":"2024-12-30T16:42:00.892Z","dependency_job_id":"aedc1d86-6837-4c09-9d63-0f7983cb68d4","html_url":"https://github.com/NaturalIntelligence/fast-xml-parser","commit_stats":{"total_commits":809,"total_committers":98,"mean_commits":8.255102040816327,"dds":"0.33621755253399255","last_synced_commit":"eb8aa89a3cdf195164d120c60d4bf0d6e730488f"},"previous_names":[],"tags_count":90,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Ffast-xml-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Ffast-xml-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Ffast-xml-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Ffast-xml-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaturalIntelligence","download_url":"https://codeload.github.com/NaturalIntelligence/fast-xml-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253680066,"owners_count":21946503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","fast","fast-xml-parser","js","js2xml","json","json2xml","locale","parser","rapid","validate","validator","xml","xml2js","xml2json","xml2nimn"],"created_at":"2024-09-24T20:13:16.087Z","updated_at":"2026-02-20T06:04:28.119Z","avatar_url":"https://github.com/NaturalIntelligence.png","language":"JavaScript","readme":"# [fast-xml-parser](https://www.npmjs.com/package/fast-xml-parser)\n\n[![NPM total downloads](https://img.shields.io/npm/dt/fast-xml-parser.svg)](https://npm.im/fast-xml-parser)\n\nValidate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++ based libraries and no callback.\n\n\u003cimg align=\"right\" src=\"static/img/fxp_logo.png\" width=\"180px\" alt=\"FXP logo\"/\u003e\n\n* Validate XML data syntactically. Use [detailed-xml-validator](https://github.com/NaturalIntelligence/detailed-xml-validator/) to verify business rules.\n* Parse XML to JS Objects and vice versa\n* Common JS, ESM, and browser compatible\n* Faster than any other pure JS implementation.\n\nIt can handle big files (tested up to 100mb). XML Entities, HTML entities, and DOCTYPE entites are supported. Unpaired tags (Eg `\u003cbr\u003e` in HTML), stop nodes (Eg `\u003cscript\u003e` in HTML) are supported. It can also preserve Order of tags in JS object\n\n---\n# Your Support, Our Motivation\n\n## Try out our New Thoughts\n\n- WishIn - You need it if negative thoughts take over all the time \u003cbr\u003e\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.solothought.wishin\"\u003e \u003cimg src=\"https://solothought.com/products/assets/images/wishin/YouTubeThumbnail.png\" width=\"500px\"/\u003e \u003c/a\u003e\n- **Flowgger**: 90% less logs size and 90% less debugging time\u003cbr\u003e\n\u003ca href=\"https://github.com/solothought/flowgger\"\u003e \u003cimg src=\"static/img/flowgger_h.webp\" alt=\"Flowgger Logging Framework\" width=\"300px\"/\u003e\u003c/a\u003e\n- [Text2Chart](https://solothought.com/text2chart/flow): interactive flow chart out of simple text.\n\n## Financial Support\n\nSponsor this project\n\n\u003ca href=\"https://github.com/sponsors/NaturalIntelligence\"\u003e \n  \u003cimg src=\"https://raw.githubusercontent.com/NaturalIntelligence/ThankYouBackers/main/github_sponsor.png\" width=\"180\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/donate\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://opencollective.com/fast-xml-parser/donate/button@2x.png?color=blue\" width=180 /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://paypal.me/naturalintelligence\"\u003e \u003cimg src=\"static/img/support_paypal.svg\" alt=\"donate button\" width=\"180\"/\u003e\u003c/a\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003c!--\n### Current Sponsors\n\nCheck the complete list at [ThankYouBackers](https://github.com/NaturalIntelligence/ThankYouBackers) for our sponsors and supporters.\n\nThrough Github\n\n\u003ca href=\"https://github.com/skunkteam\" target=\"_blank\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/46373671?s=60\" width=\"60px\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/getsentry\" target=\"_blank\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1396951?s=60\" width=\"60px\"\u003e\u003c/a\u003e\n\nThrough OpenCollective\n\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/0/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/1/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/2/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/3/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/4/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/5/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/6/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/7/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/8/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fast-xml-parser/sponsor/9/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/sponsor/9/avatar.svg\"\u003e\u003c/a\u003e\n--\u003e\n\n![fxp_sponsors](https://raw.githubusercontent.com/NaturalIntelligence/ThankYouBackers/main/assets/NI_sponsors.jpg)\n\n\u003e This is a donation. No goods or services are expected in return. Any requests for refunds for those purposes will be rejected.\n\n## Users\n\n\u003ca href=\"https://github.com/renovatebot/renovate\" title=\"renovate\" \u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/38656520\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://vmware.com/\" title=\"vmware\" \u003e \u003cimg src=\"https://avatars0.githubusercontent.com/u/473334\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.microsoft.com/\" title=\"microsoft\" \u003e \u003cimg src=\"https://avatars0.githubusercontent.com/u/6154722\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"http://ibm.github.io/\" title=\"IBM\" \u003e \u003cimg src=\"https://avatars2.githubusercontent.com/u/1459110\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"http://www.smartbear.com\" title=\"SmartBear Software\" \u003e \u003cimg src=\"https://avatars2.githubusercontent.com/u/1644671\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"http://nasa.github.io/\" title=\"NASA\" \u003e \u003cimg src=\"https://avatars0.githubusercontent.com/u/848102\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/prettier\" title=\"Prettier\" \u003e \u003cimg src=\"https://avatars0.githubusercontent.com/u/25822731\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"http://brain.js.org/\" title=\"brain.js\" \u003e \u003cimg src=\"https://avatars2.githubusercontent.com/u/23732838\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/aws\" title=\"AWS SDK\" \u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/2232217\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"http://www.fda.gov/\" title=\"Food and Drug Administration \" \u003e \u003cimg src=\"https://avatars2.githubusercontent.com/u/6471964\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"http://www.magento.com/\" title=\"Magento\" \u003e \u003cimg src=\"https://avatars2.githubusercontent.com/u/168457\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/SAP\" title=\"SAP\" \u003e \u003cimg src=\"https://user-images.githubusercontent.com/7692328/204835214-d9d25b58-e3df-408d-87a3-c7d36b578ee4.png\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/postmanlabs\" title=\"postman\" \u003e \u003cimg src=\"https://user-images.githubusercontent.com/7692328/204835529-e9e290ad-696a-49ad-9d34-08e955704715.png\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/react-native-community\" title=\"React Native Community\" \u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/20269980?v=4\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/googleapis\" title=\"Google APIs\" \u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/16785467?v=4\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/langchain-ai\" title=\"Langchain AI\" \u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/126733545?v=4\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/withastro\" title=\"Astro websie builder\" \u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/44914786?v=4\" width=\"60px\" \u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/baidu\" title=\"Baidu\" \u003e \u003cimg src=\"https://avatars.githubusercontent.com/u/13245940?v=4\" width=\"60px\" \u003e\u003c/a\u003e\n[more](./USERs.md)\n\n\u003csmall\u003eThe list of users are mostly published by Github or communicated directly. Feel free to contact if you find any information wrong.\u003c/small\u003e\n\n---\n\n# More about this library\n\n## How to use\n\nTo use as package dependency\n`$ npm install fast-xml-parser` \nor \n`$ yarn add fast-xml-parser`\n\nTo use as system command\n`$ npm install fast-xml-parser -g` \n\nTo use it on a **webpage** include it from a [CDN](https://cdnjs.com/libraries/fast-xml-parser)\n\n**Example**\n\nAs CLI command\n```bash\n$ fxparser some.xml\n```\n\nIn a node js project\n```js\nconst { XMLParser, XMLBuilder, XMLValidator} = require(\"fast-xml-parser\");\n\nconst parser = new XMLParser();\nlet jObj = parser.parse(XMLdata);\n\nconst builder = new XMLBuilder();\nconst xmlContent = builder.build(jObj);\n```\n\nIn a HTML page\n```html\n\u003cscript src=\"path/to/fxp.min.js\"\u003e\u003c/script\u003e\n:\n\u003cscript\u003e\n  const parser = new fxparser.XMLParser();\n  parser.parse(xmlContent);\n\u003c/script\u003e\n```\n\nBundle size\n\n| Bundle Name        | Size |\n| ------------------ | ---- |\n| fxbuilder.min.js   | 6.5K |\n| fxparser.min.js    | 20K  |\n| fxp.min.js         | 26K  |\n| fxvalidator.min.js | 5.7K |\n\n## Documents\n\u003ctable\u003e\n  \u003ctr\u003e\u003ctd\u003ev3\u003c/td\u003e\u003ctd\u003ev4 and v5\u003c/td\u003e\u003ctd\u003ev6\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ca href=\"./docs/v3/docs.md\"\u003edocuments\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\u003col\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v4/1.GettingStarted.md\"\u003eGetting Started\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v4/2.XMLparseOptions.md\"\u003eXML Parser\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v4/3.XMLBuilder.md\"\u003eXML Builder\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v4/4.XMLValidator.md\"\u003eXML Validator\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v4/5.Entities.md\"\u003eEntities\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v4/6.HTMLParsing.md\"\u003eHTML Document Parsing\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v4/7.PITags.md\"\u003ePI Tag processing\u003c/a\u003e\u003c/li\u003e\n    \u003c/ol\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003col\u003e\n      \u003cli\u003e\u003c/li\u003e\u003ca href=\"./docs/v6/1.GettingStarted.md\"\u003eGetting Started\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v6/2.Features.md\"\u003eFeatures\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v6/3.Options.md\"\u003eOptions\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v6/4.OutputBuilders.md\"\u003eOutput Builders\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"./docs/v6/5.ValueParsers.md\"\u003eValue Parsers\u003c/a\u003e\u003c/li\u003e\n    \u003c/ol\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n**note**: \n- Version 6 is released with version 4 for experimental use. Based on its demand, it'll be developed and the features can be different in final release.\n- Version 5 has the same functionalities as version 4.\n\n## Performance\n\u003csmall\u003enegative means error\u003c/small\u003e\n\n### XML Parser\n\n\u003cimg align=\"left\" src=\"./docs/imgs/XMLParser_v4.png\" width=\"45%\" /\u003e\n\u003cimg src=\"./docs/imgs/XMLParser_large_v4.png\" width=\"47%\" /\u003e\n\n* Y-axis: requests per second\n* X-axis: File size\n\n### XML Builder\n\n\u003cimg src=\"./docs/imgs/XMLBuilder_v4.png\" width=\"50%\" /\u003e\n* Y-axis: requests per second\n\n\u003c!-- [![](static/img/ni_ads_ads.gif)](https://github.com/NaturalIntelligence/ads/) --\u003e\n\n---\n\n## Usage Trend\n\n[Usage Trend of fast-xml-parser](https://npm-compare.com/fast-xml-parser#timeRange=THREE_YEARS)\n  \n\u003ca href=\"https://npm-compare.com/fast-xml-parser#timeRange=THREE_YEARS\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://npm-compare.com/img/npm-trend/THREE_YEARS/fast-xml-parser.png\" width=\"50%\" alt=\"NPM Usage Trend of fast-xml-parser\" /\u003e\n\u003c/a\u003e\n\n# Supporters\n#### Contributors\n\nThis project exists thanks to [all](graphs/contributors) the people who contribute. [[Contribute](docs/CONTRIBUTING.md)].\n\n\u003ca href=\"graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n\n#### Backers from Open collective\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/fast-xml-parser#backer)]\n\n\u003ca href=\"https://opencollective.com/fast-xml-parser#backers\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fast-xml-parser/backers.svg?width=890\"\u003e\u003c/a\u003e\n\n\n\n# License\n* MIT License\n\n![Donate $5](static/img/donation_quote.png)\n","funding_links":["https://github.com/sponsors/NaturalIntelligence","https://opencollective.com/fast-xml-parser","https://paypal.me/naturalintelligence","https://opencollective.com/fast-xml-parser/donate"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalintelligence%2Ffast-xml-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaturalintelligence%2Ffast-xml-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalintelligence%2Ffast-xml-parser/lists"}