cURL to XML Converter
Paste a cURL command. Get clean XML back.
What this tool does
If you have ever recorded an HTTP call in Chrome DevTools, hit "Copy as cURL", and then needed to ship that same request to a SOAP vendor or an XML-first test harness, you know the drill — you sit there manually restructuring headers and the JSON body into XML elements. This tool skips that. Paste the cURL command as-is, backslash line continuations and all, and you get a single well-formed XML document describing the full request: method, URL, query params, headers, auth, and body.
The parser understands the flags you actually use day-to-day — -X for the method, -H for each header, -d/--data for the body, -u for basic auth, -b for cookies, and the backslash-newline continuations curl(1) uses for readable multi-line commands. Single and double quoted arguments are both handled, and URL query strings are split out into their own <QueryParams> block so you can see each parameter on its own line.
If the request carries a JSON body, it is embedded as a nested <Body> element — every field from the JSON payload becomes its own XML element, preserving the shape (objects nest, arrays repeat). Form-urlencoded bodies are broken out into key/value pairs. Anything cURL does not recognise — the occasional --compressed, -k, or a flag you passed — is collected into an <Options> block so nothing is silently dropped. The result is an XML document you can feed into a SOAP client, commit as a test fixture, or paste into documentation.
How to use it
Three steps. Works the same whether the cURL is a single line or twenty lines with backslash continuations.
Paste the cURL (or try the sample)
Drop your cURL command into the left editor. Leave the \ line continuations where they are, keep the single quotes around the body, do not strip any flags. Click Load Sample if you want to see a realistic HTTP example first.
Chrome, Firefox, and Safari all have a "Copy as cURL" / "Copy as cURL (bash)" option in their Network panel — that output pastes in cleanly. Postman also has "Code snippets → cURL" which works.
Hit Convert
Click the green Convert button. The tool parses the command, pulls out method, URL, query string, headers, auth, and body, and builds the XML in one pass. You will see a short loading indicator while it runs.
Copy the XML
The right panel fills with indented, well-formed XML that any HTTP-aware tool or standards-compliant XML parser will accept. Copy it straight into a SOAP request, a test fixture, or your API docs.
When this actually comes in handy
SOAP envelope generation from a DevTools recording
You recorded a REST call in the browser, but the downstream vendor still speaks SOAP. Paste the cURL and use the resulting XML as a starting point for the envelope body — method, URL, and payload shape are already laid out.
Test fixtures for XML-first tools
SoapUI, ReadyAPI, and older enterprise testing kits want XML input files. Convert a working cURL into XML once and commit it as a fixture instead of hand-maintaining two parallel formats.
Legacy enterprise vendor integrations
Partner APIs that still run on WSDL/SOAP or XML gateways will not accept cURL scripts. Handing them an XML request they can load directly into their side saves a round trip of "what does your endpoint actually expect".
API documentation and snippets
You want your README to show the same request in two shapes — cURL for developers, XML for the ops team reviewing traffic. Generate the XML from the cURL once and keep them in sync.
Common questions
Which cURL flags are supported?
The common ones: -X/--request for HTTP method, -H/--header for each header (repeat as many times as you like), -d/--data/--data-raw/--data-binary for the request body, -u/--user for basic auth, and -b/--cookie for cookies. The full flag reference is on curl.se/docs/manpage.html if you want to look something up.
Does it handle multi-line backslash continuations?
Yes. The \ at the end of a line followed by a newline is treated as a line continuation — exactly the way bash and cURL see it. Paste the command the way it came out of DevTools or your terminal history. You do not need to join it into one line first.
What happens to a JSON request body?
A JSON body (content-type application/json or just a -d '{...}' payload that parses as JSON) is embedded as nested XML inside a <Body> element — every field becomes its own element, objects nest, and arrays repeat. The JSON grammar follows RFC 8259, and the shape is preserved one-to-one in the XML output.
What about URL-encoded or form bodies?
A application/x-www-form-urlencoded body (e.g. -d 'user=ava&pwd=x') is broken out into individual key/value elements inside <Body>. Query-string parameters on the URL itself are pulled out into a separate <QueryParams> element so you can see each param clearly. Multipart (-F) bodies are represented as one element per part with the field name and its value.
Can I paste output from "Copy as cURL" in Chrome or Firefox?
Yes — that is the main use case. Chrome's "Copy as cURL (bash)", Firefox's "Copy as cURL", and Safari's "Copy as cURL" all paste in cleanly. The parser ignores the quoting style differences. Postman's cURL code snippet output works too.
What if my cURL has a flag the parser does not recognise?
Unknown or exotic flags (--compressed, -k, --resolve, custom long flags) are collected into an <Options> block at the end of the XML rather than being dropped on the floor. That way you can see exactly what was in the original command and decide how to represent it on the receiving side.
Other tools you may need
cURL to XML is one piece of the puzzle. These tools pair well with it: