What does the Text Reverser do?
The Text Reverser inverts, flips, and mirrors text strings online using a side-by-side dual-editor interface. It supports four distinct reversal algorithms: reversing entire character sequences, flipping the order of words in sentences, reversing letters within individual words, and reversing multiline documents from bottom to topβwith full Unicode emoji and grapheme cluster protection.
Core Concepts
Understanding text reversal behaviors:
- Character Reversal: Inverts every character in the string (e.g.,
"Blueutils"becomes"slitfeulB"). - Word Order Inversion: Reverses the order of words while preserving word spelling and spacing (e.g.,
"quick brown fox"becomes"fox brown quick"). - Individual Word Reversal: Reverses letters inside each isolated word without altering word position (e.g.,
"Hello World"becomes"olleH dlroW"). - Line Inversion: Reverses line ordering from bottom to top, ideal for analyzing chronological server logs or call stacks.
- Unicode & Grapheme Safety: Employs Unicode grapheme segmentation to prevent combined emojis (such as
π¨βπ©βπ§βπ¦orππ½) from splitting into broken surrogate pair fragments.
How to use the tool?
- Enter or Upload Text: Type or paste text into the left editor, upload a local file, or click Sample.
- Select Reversal Mode: Choose Reverse Characters, Reverse Word Order, Reverse Letters in Each Word, or Reverse Lines.
- Inspect Output: Click Reverse Text to view the flipped output instantly in the right editor.
- Copy or Export: Click Copy to copy the reversed result to your clipboard or Download to save it as a text file.
Context-Aware Practical Workflow Guides
Debugging Chronological Server Logs
- Reverse server log files bottom-to-top to review the most recent events first without opening heavy text editors.
Obfuscation & Palindrome Testing
- Test palindrome words and sentences by flipping characters and comparing original vs reversed outputs.
Related Developer Utilities
- Text Diff Tool: Compare two text documents side-by-side with line and character diff highlighting.
- Text Sorter: Sort text lists, logs, and strings alphabetically or numerically.
- Text Case Converter: Convert strings to uppercase, lowercase, camelCase, snake_case, and kebab-case.
- Add Line Numbers to Text: Prepend customizable line numbers and delimiters to multiline lists.
REST API Integration
blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/text/reverse) for programmatic text reversal.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawText |
String | The text string to reverse. | "The quick brown fox" |
mode |
String | Reversal mode: "reverse_chars", "reverse_words", "reverse_chars_in_words", or "reverse_lines". |
"reverse_words" |
preserveLines |
Boolean | Whether to maintain multiline paragraph structure (default: true). |
true |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/text/reverse \
-H "Content-Type: application/json" \
-d '{
"rawText": "The quick brown fox",
"mode": "reverse_words"
}'Python
import requests
url = "https://blueutils.com/api/text/reverse"
payload = {
"rawText": "The quick brown fox",
"mode": "reverse_words"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"rawText": "The quick brown fox",
"mode": "reverse_words"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/text/reverse"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether reversal succeeded. | true |
reversedText |
String | The converted reversed text result. | "fox brown quick The" |
stats |
Object | Word, character, and line count statistics. | { "characters": 19, "words": 4 } |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"reversedText": "fox brown quick The",
"stats": {
"characters": 19,
"words": 4,
"lines": 1,
"mode": "reverse_words"
}
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Text input cannot be empty."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to reverse text?
- Batch Text Pipelines: Integrate fast character and word flipping into automated NLP preprocessing workflows.
- Log Reversal Services: Invert descending timestamps into ascending order before log ingestion.
Native Usage
How to reverse text locally in terminal environments:
Windows (PowerShell)
# Reverse characters in PowerShell
$text = "Hello World"
$chars = $text.ToCharArray()
[Array]::Reverse($chars)
-join $charsLinux / Unix (Bash)
# Reverse characters in Linux
echo "Hello World" | rev
# Reverse line order from bottom to top
cat log.txt | tacPython
Using Python standard library:
# Reverse characters
text = "Hello World"
print(text[::-1])
# Reverse words
print(" ".join(text.split()[::-1]))Java
Using Java standard library:
public class TextReverse {
public static void main(String[] args) {
String input = "Hello World";
String reversed = new StringBuilder(input).reverse().toString();
System.out.println(reversed);
}
}