Text Cleaner API
Remove HTML, fix encoding, and normalize raw text in one API call.
Clean and normalize raw text automatically: strip HTML tags and entities, remove markdown syntax, fix encoding issues (smart quotes, em-dashes, broken UTF-8), and collapse whitespace. Returns the cleaned text alongside a diff summary of changes applied and a character reduction percentage. Ideal for preprocessing scraped content, user-generated text, or documents before indexing or analysis.
How it works
Three steps. No complex setup.
Send the raw text
Pass the raw string in the `text` field. Enable or disable operations with boolean flags: `remove_html`, `remove_markdown`, `fix_encoding`, `normalize_whitespace`. All are enabled by default.
Pipeline processing
The service applies operations in order: first strips HTML tags and entities, then fixes encoding (smart quotes, em-dashes, broken UTF-8), and finally collapses multiple spaces and line breaks.
Receive clean text with metrics
The response includes the cleaned text, original and final length, reduction percentage, and the list of transformations applied for full auditability.
Who is it for?
Response example
Real input and output. What you send and what you get back.
// Input
{
"text": "<p>Hello <strong>world</strong>! This is a test. </p>",
"remove_html": true,
"fix_encoding": true,
"normalize_whitespace": true
}// Output
{
"cleaned_text": "Hello world! This is a test.",
"original_length": 64,
"cleaned_length": 27,
"reduction_percent": 58,
"changes_applied": [
"removed HTML tags",
"fixed encoding",
"normalized whitespace"
]
}Try it now
// live demo — no account needed to try
Playground
Integrate into your project
Copy and paste. Replace YOUR_API_KEY with your real key.
curl -X POST https://jsnhengine.com/api/trpc/textCleaner.clean \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"json": {"text":"<p>Hello <strong>world</strong>! This is a test. </p>","remove_html":true,"fix_encoding":true,"normalize_whitespace":true}}'Why choose JSNH Engine Lab
Low latency
Responses in under 200ms
Secure authentication
API keys with per-plan rate limiting
Usage tracking
Every request logged with metrics
Production ready
Input validation and typed errors
Frequently asked questions
Everything you need to know before integrating.
Other modules
Expand your integration with more APIs from the catalogue.
Email Validator API
Validate email addresses instantly. Detect fake, disposable and invalid emails.
1 token / call →
Phone Validator API
Validate phone numbers from any country. Detect carrier, line type and E.164 format.
1 token / call →
URL Checker API
Verify URL accessibility, detect redirects, and extract SEO metadata instantly.
2 tokens / call →
// production ready
Start using Text Cleaner API
Sign up free and get 1,000 tokens to start. No credit card. No complex setup.