# Reverse text

Reverse text by characters, by words or by lines. Accents and emoji stay attached to their letters.

- Endpoint: `POST https://setget.net/v1/tools/reverse-text` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `reverse-text`
- Page: https://setget.net/tools/reverse-text

## Inputs

- `text` (required, string): The text to reverse.
- `by` (optional, string, one of `characters`, `words`, `lines`, default `"characters"`): What to reverse: the characters, the order of words, or the order of lines.

## Example 1

```json
{"input":{"text":"Hello, world"}}
```

Result:

```json
{"text":"dlrow ,olleH"}
```

## Example 2: Word order

```json
{"input":{"text":"one two three","by":"words"}}
```

Result:

```json
{"text":"three two one"}
```

## Example 3: Line order

```json
{"input":{"text":"first\nsecond\nthird","by":"lines"}}
```

Result:

```json
{"text":"third\nsecond\nfirst"}
```

**Does it break accented letters or emoji?** No. A letter keeps its combining accents, and emoji made of several parts (skin tones, flags, joined emoji) stay whole.
