Find the longest word

Paste any text and get the longest word in it, with its character length. If two words tie for longest, the first one encountered wins. The tokenizer is \b[\w']+\b. The transform runs in your browser; nothing uploads. For the inverse, see find shortest word.

Input
Line 1:1 LF cloud_done Saved locally
Result Longest Word
0 lines 0 chars

Longest word, by character count

The longest word is the one with the largest length in JavaScript code units, taken over all matches of \b[\w']+\b in the input. The output is one line: Longest word: "WORD" (N characters). If the input has no words at all (only punctuation, whitespace, or is empty), the output is No words found.

Ties are broken by first-encountered. The reduction iterates left-to-right and only replaces the running longest when a strictly longer word is seen. So in "abc xyz" the answer is abc, not xyz, because they tie at length 3 and abc came first.

Hyphens are word boundaries here. state-of-the-art splits into state, of, the, art; the longest of those is state. Apostrophes are inside words: don't is length 5. For the corresponding shortest tool, see find shortest word; for a full distribution, see word frequency.

How to use find the longest word

  1. 1Paste or type your text into the input panel on the left.
  2. 2The longest word and its length appear in the output panel as you type.
  3. 3Click Copy in the output header to copy the result.
  4. 4Click Download to save it as a plain-text file.
  5. 5Run find shortest word alongside for the opposite end.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Tokenizes on \b[\w']+\b

Words are runs of \w with optional internal apostrophes. Hyphens break words. Numbers count.

Length is JavaScript String.length

The character count is UTF-16 code units. For BMP Latin words this matches a hand-count of letters. Surrogate-pair characters (rare in word matches) would count as two.

Ties resolved by first-encountered

A reduce-from-left finds the maximum. The running longest is only replaced when a strictly longer word is seen, so the leftmost word in a tie wins.

No-words case

If the regex finds zero matches (empty input, or punctuation-only), the output is No words found. with no quoted word and no length.

Runs entirely in your browser

No upload, no logging. The result updates on every keystroke.

Worked example

extraordinarily is the only 15-character word; the runner-up is jumps at 5. Replace it with two 10-letter words and the first one wins by tie-break.

Input
The quick brown fox jumps over the extraordinarily lazy dog.
Output
Longest word: "extraordinarily" (15 characters)

Settings reference

Behaviour Value
Word definition \b[\w']+\b.
Length unit JavaScript String.length (UTF-16 code units).
Tie-break First-encountered wins.
Output format Longest word: "WORD" (N characters).
No-words input No words found.
Hyphenated terms Split into separate words on the hyphen.

FAQ

What if there are several words tied for longest?
The first one in the input wins. The reduction only replaces the current longest when a strictly longer word is seen.
Does state-of-the-art count as one word?
No. The hyphen is a boundary, so it splits into state, of, the, art. The longest of those is state at 5 characters.
What about contractions like don't?
They count as one word. don't is 5 characters (d, o, n, ', t).
What does the tool report on empty input?
No words found. The same message appears if the input contains only punctuation, whitespace, or no characters that match \b[\w']+\b.
Is the input sent anywhere?
No. The scan runs in your browser. Nothing uploads, nothing is logged.