# Character Counter with Spaces

> Count characters with and without spaces as you type, next to words and paragraphs. Check social-media and essay limits without uploading a word.

Source: https://devplain.com/character-counter-with-spaces/
Last updated: 2026-10-29

Count characters with and without spaces as you type, next to words and paragraphs. Check social-media and essay limits without uploading a word.

## How It Works

A character counter with spaces answers the question a form field asks most often: how many characters does this text occupy exactly as typed? The page runs the same counting engine as the main word counter, but it leads with the two character figures, because the difference between them is what decides whether a draft fits.

**Characters (with spaces).** This is the raw length of the string: every letter, digit, punctuation mark, space, tab and line break counts once. It is the figure a social-media composer, a CMS meta-description field or a grant application normally measures, because the system stores and displays the text exactly that way.

**Characters (without spaces).** The same string with every whitespace character removed first — spaces, tabs, newlines and other Unicode separators. It is the smaller number, and it is what a limit means when a style guide says "characters excluding spaces". Publications and academic style guides sometimes use this figure so that indentation and word gaps do not inflate a count.

**Where the two numbers diverge.** Prose with short words has a high space share: roughly one character in six is a space in ordinary English, so the two figures can differ by 15 to 20 percent. Technical text with long identifiers and few gaps differs far less. A pasted table with tabs and line breaks can diverge more sharply still, because every separator is one character in the first figure and nothing in the second.

**How characters are counted.** Length is measured in UTF-16 code units, the unit JavaScript strings use. Accented Latin letters and CJK characters are one unit each, while most emoji and other characters outside the basic plane are two units, so a single emoji raises the with-spaces figure by two. Nothing is normalised or trimmed, which is why pasting formatted text can produce a higher count than expected.

**Live and local.** Both figures are recalculated on every keystroke, and no text leaves the tab — the count runs as plain JavaScript on your device, so an unpublished draft or a client's copy can be pasted safely.

## Examples

### Input

```
Hello world
```

### Output

```
Characters (with spaces): 11; Characters (without spaces): 10; Words: 2; Sentences: 1
```

The single space is the only difference between the two character figures.

### Input

```
Hello, world!
```

### Output

```
Characters (with spaces): 13; Characters (without spaces): 12; Words: 2; Sentences: 1
```

Punctuation counts in both figures; only whitespace is removed from the second.

### Input

```
Hello 👋 world
```

### Output

```
Characters (with spaces): 14; Characters (without spaces): 12; Words: 2; Sentences: 1
```

Boundary case: the emoji occupies two UTF-16 units, so the with-spaces figure is two higher than the visible glyph count suggests.

### Input

```

```

### Output

```
Characters (with spaces): 3; Characters (without spaces): 0; Words: 0; Sentences: 0
```

Boundary case: three spaces count as three characters, and stripping them leaves nothing.

## Frequently Asked Questions

**What is the difference between characters with and without spaces?**

The with-spaces figure counts the text exactly as typed, including every space, tab and line break. The without-spaces figure removes all whitespace before counting. On ordinary English prose the gap is around 15 to 20 percent, so a 280-character limit including spaces is roughly a 230-character draft excluding them.

**Which count do social media limits use?**

Almost all of them include spaces, because the composer counts the string it will store. The number to copy is therefore Characters (with spaces). When a platform also treats emoji or links specially, its own composer remains the authority; this page tells you the raw count the text carries.

**Do emoji count as one character or two?**

Two here, because length is measured in UTF-16 code units and emoji outside the basic plane occupy a surrogate pair. Accented Latin letters and CJK characters are one each. Some platforms display an emoji as one character, so a post near the limit can differ by a few characters between this counter and the composer.

**Should I use this page or the word counter for an essay?**

Use the word counter when the requirement is stated in words, which is the usual rule for essays. Use this page when the requirement is stated in characters, with or without spaces, or when you are trimming a title, abstract or bio to a field width. Both pages read the same engine, so the other metrics always agree.

## Limitations & Accuracy

Length is measured in UTF-16 code units, so most emoji and other characters outside the basic plane count as two and an accented letter may count as two if it arrives decomposed. CRLF line endings from Windows count as two characters, not one. The without-spaces figure removes all whitespace, including tabs and line breaks, not just the space bar. Nothing is trimmed or normalised, and very large pastes are limited only by browser memory.

## Related Tools

- [Word Counter](https://devplain.com/word-counter/)
- [Word Counter for Essays](https://devplain.com/word-counter-for-essays/)
- [All tools](https://devplain.com/tools/)

Last updated: 2026-10-29

