---
name: xml-formatter
description: "XML Formatter (XML Formatter / Minifier) via devops.majbase.com's free public API, no key required. Keywords: pretty print xml, minify xml, format xml."
---

# XML Formatter

XML Formatter / Minifier. Calls devops.majbase.com's free public API — no API key or authentication required.

## Endpoint

```
POST https://devops.majbase.com/xml-formatter/api
```

## Request / Response

```
API: POST /xml-formatter/api
  action=format|minify  (required)
  xml=<string>           (required)
  indent=<int>            (optional, default 2, format only — number of spaces)
Returns {"result": "..."}, or {"error": "..."}.
```

## Example

```bash
curl -sS -X POST https://devops.majbase.com/xml-formatter/api -H "Content-Type: application/json" -d '{"action":"format","xml":"<root><a>1</a></root>"}'
curl -sS -X POST https://devops.majbase.com/xml-formatter/api -H "Content-Type: application/json" -d '{"action":"minify","xml":"<root>\n  <a>1</a>\n</root>"}'
```

## Notes

- No API key or authentication required.
- Full interactive tool: https://devops.majbase.com/xml-formatter/
