EditSafely

Number of Words in a String

Count how many words a string contains.

Runs on your device, nothing uploaded

Try:

0 chars · 0 lines

Output

Count how many words a string contains.

Type or paste above to see the result here.

Example: Count words

What you paste never leaves this tab

Number of Words in a String is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, the text you paste is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.

  • No upload
  • No length limit
  • Works offline once loaded
  • Nothing stored or logged

How to use Number of Words in a String

  1. 1. Paste your text. Enter the text you want counted into the input pane, a single sentence, a paragraph, or a full document.
  2. 2. Read how words are counted. A word is a run of letters or digits; contractions, hyphenated words and decimals such as don't, e-mail and 3.14 count once, while an ellipsis or dash between words separates them.
  3. 3. Read the word count. The big number is the word count, with tiles for characters, sentences, average word length and reading time.

When to use Number of Words in a String

Number of Words in a String counts the words in a piece of text, the same figure most editors show in their status bar. It's for checking length requirements on essays, articles and short-form content without opening a full word processor.

  • Checking an essay against a word limit. An assignment or application requires a response under 500 words. Pasting your draft here gives an instant count so you can trim or expand before submitting.
  • Meeting a minimum length for an SEO article. A content brief specifies a minimum word count for search ranking purposes. Checking a draft against that target tells you whether more sections are needed.
  • Estimating translation cost from source text. Translation services often quote by word count. Counting the source text here gives you a number to compare against a quoted rate before committing to a project.
  • Verifying a tweet or caption fits a platform's limit. Some platforms count differently than characters alone, and you want a quick word-level sense of a caption's length before trimming it to fit.

Examples

Count words

Input

the quick fox

Output

3

Contractions, numbers and hyphens

Input

don't stop…now 3.14 e-mail

Output

5

About the Number of Words in a String tool

Number of Words in a String is a free online tool that works entirely inside your web browser. Count how many words a string contains. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.

This page is one of 159 String utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.

There is nothing to configure. Provide the input and the result appears on its own. 2 worked examples further down the page show exactly what the tool produces for real inputs.

Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every step is handled on your own machine rather than by a remote API.

Frequently asked questions

Does Number of Words in a String cost anything?

Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.

Is it safe to paste sensitive or confidential data?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How much text can I process at once?

There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.