ForHosting KIT · Text & AI

Find longest word

Find the longest word in a passage and how many letters it has: in a sentence about English puzzles, supercalifragilisticexpialidocious wins with 34 letters. Ties are all listed, which helps with typography fit and word games. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Finding the longest word in a passage is a sharp, everyday check for typography fit, readability reviews, and word puzzles. Paste non-empty text and this capability scans Unicode letter runs, measures each token by letter count, and reports the winning word together with its length. When several words share that maximum, every distinct winner is listed in first-seen order so ties are visible instead of hidden. Punctuation, digits, and emoji act only as separators, so a trailing comma never inflates a length and never becomes a fake champion. Empty strings and punctuation-only input fail with invalid input rather than inventing a zero-length answer.

How longest-word detection works and what counts as a word

Search intent for find longest word is narrower than a general word counter or a unique-word list: people want the maximum letter length and the identity of every word that ties at that length. This capability defines a word as a maximal contiguous run of Unicode letters, including combining marks that sit on those letters so café and a decomposed cafe-plus-acute both stay one token.

Spaces, tabs, line breaks, digits, emoji, and all punctuation act only as separators, so a comma after a token never inflates length and never creates a fake word. Length is the count of Unicode letters inside the token, not JavaScript UTF-16 code units and not the visual width in a particular font. Hello has five letters, a has one, and supercalifragilisticexpialidocious has thirty-four.

Hyphenated compounds such as well-known become two words, well and known, because the hyphen is a separator; contractions such as don't become don and t for the same reason. That rule is intentional and stable: ignoring punctuation means punctuation never joins letters into a longer token, which is exactly what typography-fit checks need when they ask how wide the longest unbreakable letter run will be.

After tokenization the engine walks every word once, tracks the largest length seen, then collects distinct surface forms whose letter count equals that maximum, preserving first-seen order so ties are reproducible across runs.

Readability and jargon checks

Editors scan drafts to surface sesquipedalian words that hurt reading ease, then decide whether to keep, hyphenate, or replace them.

Does punctuation count toward word length?

No. Only Unicode letters form words and add to length. Commas, quotes, hyphens, digits, and emoji are separators and never inflate the count.

What happens when two words tie for the longest?

Every distinct word with the top length is listed, in the order it first appears in your text. Nothing is hidden, so you can see all the candidates at once.

Is a hyphenated word counted as one word?

No. The hyphen works as a separator, so well-known becomes two words, well and known. Contractions split the same way: don't becomes don and t.

Does it work with accented letters?

Yes. Accented letters count as letters, so café stays one word even when the accent was typed as a separate mark. Length is a count of letters, not the width the word takes in a font.

Do numbers count as words?

No. Digits, emoji and punctuation only separate words. A text made only of numbers and punctuation is rejected, because it does not contain a single word to measure.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/str/longest-word

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/str/longest-word \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"The quick brown fox jumps over the lazy dog."}'
{
  "text": "The quick brown fox jumps over the lazy dog."
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "str.longest_word",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_chars100000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Successful API calls are billed at $0.002 per item; validation failures are not charged.

Input contract, response fields, and empty or wordless text

An empty string, a string of only spaces, or a string of only digits and punctuation also fails, because no letter-bearing word was found—the error message states that text must contain at least one word and that punctuation alone is not enough. POST a JSON body with the required string field text set to the passage you want scanned. Aliases input, value, s, content, and body are accepted so form generators and older clients can post under familiar names. The value must be a string; objects, arrays, booleans, and non-finite numbers fail with invalid_input naming the problem. Payloads longer than the documented character cap fail the same way so a single request cannot monopolize Worker memory. Those validation failures are not billed on the prepaid API. On success the response echoes text for UI tables, reports total_words as how many letter runs were found, longest_length as the maximum letter count, longest_word as the first winner in reading order, longest_words as the ordered list of distinct words that share that length, tie_count as the length of that list, and method always set to longest_word so clients can branch without sniffing shapes. Example: The quick brown fox jumps over the lazy dog yields total_words nine, longest_length five, longest_word quick, and longest_words containing quick, brown, and jumps. A line that includes supercalifragilisticexpialidocious yields longest_length thirty-four with a single winner. Use longest_word and longest_length when a badge only needs the first champion; use longest_words when you must show every tie for a puzzle key or a layout review.

Typography fit, readability, puzzles, pricing, and practical limits

Call the free in-browser find longest word tool when you need a hard number for typography fit: the longest letter run in a headline, a sidebar, a table cell, or a print column is the token most likely to overflow if the font cannot wrap it. Readability reviewers use the same number to flag sesquipedalian jargon that will slow a general audience, and puzzle authors use it to confirm that a grid, a riddle, or a word-search bank really does contain the intended champion. Do not expect font metrics, kerning, or rendered pixel width—those depend on a typeface and a layout engine this parse path does not run. Use the prepaid KIT API when a CMS, layout pipeline, tutoring app, or mobile client needs the same contract under balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. A typical workflow pastes a paragraph, reads longest_length, and compares it against a column width measured in ems or characters. Pair this endpoint with a word-count or unique-word tool when the next step is volume or vocabulary analysis, but keep find-longest-word as its own landing so the maximum-length intent is not mixed with shortest-word queries, frequency tables, or SEO keyword extraction.

Typography fit for headlines and columns

Designers paste a headline or sidebar and read longest_length to see whether the longest letter run will overflow a narrow column or button.

Word puzzles and CI fixtures

Puzzle authors and build scripts pin the longest champion and its ties so grids, riddles, and tokenization regressions stay honest.

How do I find the longest word in a text?

Send JSON with text set to your passage. The response includes longest_word, longest_length, and longest_words listing every distinct word that achieves that maximum letter count.

What if several words share the same longest length?

They are all returned in longest_words in first-seen order. longest_word is the first of those winners, and tie_count equals how many distinct winners there are.

What happens if the text has no words?

The request fails with invalid_input. Empty strings and punctuation-only input are rejected and are not billed on the prepaid API.

What does the longest-word finder cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →