Count characters in a text with and without spaces.
Character limits are enforced on the raw string, which means whitespace counts — and it is typically 15 to 18 percent of English prose, so a 160-character SMS holds only about 135 characters of actual letters. Whether spaces are included depends on the context: translation and typesetting rates are usually quoted excluding spaces, while SMS segments, meta descriptions, form validation and database column widths all count them. Reporting both figures alongside the whitespace total makes it clear which constraint you are up against and how much of your budget is being spent on separators.
Character counts
With spaces = string length; without spaces = length after removing all whitespace
Headroom
Remaining = character limit - counted characters
Almost always yes for technical limits — SMS segments, meta descriptions, form fields and database columns all count every character in the string. Excluding spaces is a convention from translation and typesetting pricing, where it reflects the work involved rather than storage.
Usually line endings or Unicode. A Windows line break is two characters where a Unix one is one, and emoji or accented characters can occupy multiple code units depending on how the tool counts. For hard technical limits, always confirm against the target system.