Check a database constraint
Measure a candidate value before saving it into a field with a known application or database length limit.
Processed locally
Paste or type text to calculate string length, Unicode code points, graphemes, UTF-8 bytes, whitespace-aware length, and word count entirely in your browser.
Overview
String Length Online calculates useful text measurements directly from pasted or typed input. It preserves the original total, whitespace-aware, and word counts while adding JavaScript UTF-16 length, Unicode code points, user-perceived graphemes, and UTF-8 byte size in the browser.
Workflow
Follow the core workflow below. Use “Show in tool” to locate the real control in the live tool above.
Enter the text in Text to analyze. The metrics update live as you type or paste.
Text to analyzeUse Total characters, Characters, and Word count for the basic view. The current tool ignores leading and trailing whitespace before calculating the metrics.
Total charactersCharactersWord countJavaScript length counts UTF-16 code units. Unicode code points and Visible graphemes give Unicode-aware views, while UTF-8 bytes shows encoded byte size.
JavaScript lengthUnicode code pointsVisible graphemesUTF-8 bytesYou can now use the measurement that matches the runtime, UI, storage, or payload limit you are debugging.
Practical cases
Measure a candidate value before saving it into a field with a known application or database length limit.
Contrast total length with the value after whitespace is removed to diagnose unexpected padding or line breaks.
Troubleshooting
From evidence to action
Use the measured value with the target runtime or storage limit when asking a coding agent to diagnose truncation, validation, encoding, or normalization behavior.
Developer guides
Understand the concept, inspect a testable example, then open it in the tool above.
FAQ