# Text cleaner

> Clean text copied from a PDF, Word or a web page: remove extra spaces, line breaks, HTML tags and curly quotes in one pass. Free online tool.

Free tool by Orkosi. Page: https://orkosi.com/tools/text-cleaner

Text copied from a PDF breaks in the middle of sentences; text from Word brings curly quotes; text from a web page brings tags. Tick what to remove and get clean text back.

1. Paste the messy text.
2. Tick what to clean.
3. Press Convert and copy the result.

## Input

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `text` | text | yes | Text. |
| `collapse_spaces` | true \| false | no | Collapse repeated spaces. Default: true. |
| `trim_lines` | true \| false | no | Trim each line. Default: true. |
| `remove_empty_lines` | true \| false | no | Remove empty lines. Default: false. |
| `straighten_quotes` | true \| false | no | Straighten quotes and dashes. Default: false. |
| `strip_html` | true \| false | no | Strip HTML tags. Default: false. |
| `remove_line_breaks` | true \| false | no | Remove line breaks. Default: false. |

## Example

Input:

```json
{
  "text": "<p>Our   “new”  pricing — live   today.</p>\n<p>  Start free,   upgrade later…  </p>",
  "strip_html": true,
  "straighten_quotes": true
}
```

Result:

```json
{
  "output": "Our \"new\" pricing - live today.\n\nStart free, upgrade later...",
  "characters_before": 83,
  "characters_after": 61,
  "removed": 22
}
```

## Run it

It needs a free Orkosi account, nothing else. No credits are used.

- **A person**: open the page, enter an e-mail once, use the tool.
- **Claude or ChatGPT**: add the Orkosi connector `https://orkosi.com/api/v1/public/mcp` and sign in, or create the free account on the sign-in page. Then call `orkosi_run_free_tool` with `{ "tool": "text-cleaner", "input": { … } }`.
- **Any agent or program that can make an HTTP request**:

  1. Once, create the account: `POST https://orkosi.com/api/v1/public/signup` with `{ "name": "…", "email": "…", "terms_accepted": true }` and no key. Ask the person for the e-mail and their agreement to the terms first. The answer carries `data.api_key`, shown once.
  2. Run the tool:

```bash
curl -X POST https://orkosi.com/api/v1/public/tools/text-cleaner/run \
  -H "Authorization: Bearer $ORKOSI_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":{"text":"<p>Our   “new”  pricing — live   today.</p>\n<p>  Start free,   upgrade later…  </p>","strip_html":true,"straighten_quotes":true}}'
```

The answer is `{ "data": { "tool": "…", "result": { … } } }`. A call without a key is answered 401 with the signup steps as data.

## Questions

**How do I fix line breaks from a PDF?**

Turn on Remove line breaks: every break becomes a single space, so paragraphs flow again.

**What does Straighten quotes do?**

It replaces curly quotes, long dashes, ellipsis characters and non-breaking spaces with their plain keyboard forms, which is what code and CSV files need.

**Does Strip HTML keep the text?**

Yes. Tags are removed, paragraphs and list items become line breaks, and scripts and style blocks are dropped with their content.

All free tools: https://orkosi.com/tools.md
