Skip to content
Buy me a coffee
String Escaper & Utilities

String Utilities

Handy string utilities: upper/lower case, reverse, character and word count, string splitter and detailed character information (decimal, octal, hex, unicode, HTML entity).

Change case, reverse, sort and count

0 characters · 0 words · 0 lines
Case
Lines
Count
Ctrl + Enter = Lowercase

String Splitter

Default is to split on every character. Use \f for form feeds, \n for new lines, \r for carriage returns, \t for tabs. Check "Regular expression" to split with a regex.
Options

Detailed Character Information

Details are shown for the first character; a summary table lists every character when you paste several.
Updates as you type

About the string utilities

Case conversion

  • Lowercase / Uppercase: uses the Unicode case mapping, so accented and non-Latin letters are converted too (É → é, ß → SS).
  • Title Case: capitalizes the first letter of every word and lowercases the rest. Hyphenated words are treated as separate words (well-knownWell-Known).
  • Sentence case: lowercases everything, then capitalizes the first letter of each sentence (after ., !, ?) and of each line. The pronoun I is kept in uppercase.
  • camelCase / snake_case / kebab-case: splits the text into words on whitespace, punctuation and letter-case boundaries (parseHTTPResponseparse HTTP Response), then joins them back in the requested style. Each line is converted independently, so a column of identifiers can be converted at once.
  • sWAP cASE: inverts the case of every letter.

Line utilities

  • Reverse reverses the characters of the whole text (grapheme-aware, so emoji and accented characters stay intact); Reverse lines reverses the order of the lines.
  • Trim lines removes leading and trailing whitespace from every line; Remove blank lines drops lines that are empty or whitespace-only.
  • Remove duplicate lines keeps the first occurrence of each line (comparison is exact and case-sensitive).
  • Sort lines uses a natural, locale-aware ordering: file2 comes before file10 and accented letters sort next to their base letter. Shuffle randomizes the order (Fisher–Yates).
  • Number lines prefixes each line with its 1-based number, padded so that they align.

Counting

Character count reports characters with and without whitespace, the number of UTF-16 code units (what JavaScript's length returns), the size in bytes once encoded as UTF-8, plus lines, sentences and paragraphs. Word count reports words, unique words, average word length and an estimated reading time at 200 words per minute; Word frequency lists the most common words.

On word boundaries: a word is a run of letters, digits, underscores, apostrophes and hyphens ([\p{L}\p{N}_'’-]+). Contractions like don't and hyphenated compounds like state-of-the-art therefore count as one word, and CJK text without spaces counts as a single word per run, which matches what most word processors do. Sentences end with ., ! or ? followed by whitespace or the end of the text; paragraphs are separated by at least one blank line.

String splitter

The splitter cuts the text at every occurrence of the token and joins the resulting pieces with the separator you choose. Leave the token empty to split into individual characters. Escape sequences accepted in the token:

SequenceMeaning
\nNew line (LF). Windows line endings (CRLF) are also matched.
\rCarriage return (CR)
\tHorizontal tab
\fForm feed
\vVertical tab
\0Null character
\\A literal backslash
\uXXXXThe character with the given hexadecimal code, e.g.   for a non-breaking space

With Regular expression checked the token is compiled as a JavaScript regex (flags gu): [,;]\s* splits on commas or semicolons followed by optional spaces, \d+ splits on any number, and a capturing group would include the separators in the output. Choose JSON array as the joiner to get a ready-to-use array literal.

Character information

Paste any character (including emoji and characters outside the Basic Multilingual Plane) to see its code point in decimal, octal and hexadecimal, its Unicode notation (U+1F600), the escape sequences to use in Java, JavaScript, JSON, CSS and HTML, its URL-encoded form, its UTF-8 and UTF-16 byte representation, and its Unicode general category and script. Characters above U+FFFF are shown as a UTF-16 surrogate pair (😀) because that is how Java, JavaScript and JSON represent them.