Zero Signup ToolsFree browser tools

Text Tools

Line Length Checker

Measure the length of every line of text or code and flag lines over a set width. Reports the longest line, character vs display width, and tab-aware columns.

0 chars

Settings

Measure by

Tabs expand to a tab stop and wide CJK or emoji count as two columns, matching an editor ruler.

Tab width

Awaiting input. Paste text on the left to measure every line.
Characters vs display width, and why a tab is not one column

Two lines with the same number of characters can occupy very different widths on screen. A tab does not take one column: it advances the cursor to the next tab stop, the next column that is a multiple of the tab width, so the code after it stays aligned. East Asian characters and most emoji take two columns each, while combining accent marks and zero-width characters take none. This tool measures display width with those rules so the number matches what an editor ruler or terminal shows, which is what a max line length rule is really limiting.

Switch to Characters to count Unicode code points instead. That mode counts an emoji as one and ignores tab stops, which is the right measure when a field has a hard character cap rather than a visual width budget. Common width limits include 79 columns for Python (PEP 8), 80 for Prettier and many C and Go style guides, 100 or 120 for teams that prefer wider lines, and around 72 for the body of a Git commit message.

How to use

  1. Paste your text or code into the input box, or press Load sample to try a worked example with a few over-length lines.
  2. Choose how to measure: Display width (tab-aware monospace columns) or Characters (Unicode code points).
  3. Set the maximum line length directly or pick a preset such as 79 (PEP 8), 80 (Prettier), 100, or 120, and choose the tab width for display-width mode.
  4. Read the summary for the longest line, the average width, and how many lines are over the limit.
  5. Scan the ruler view of the longest line to see where it overflows, and use the table to review every line that is too long.
  6. Click Copy line numbers to grab the offending lines, or Copy report for the full plain-text breakdown.

About this tool

Line Length Checker measures how long every line in a block of text or code is and tells you which lines run past a width you set. A word counter gives you a single total; this tool works line by line so you can answer the questions a style guide and a code review actually care about: which line is the longest, exactly how long is it, how many lines break the column limit, and by how much. It reports two different lengths because they are genuinely different numbers. Characters counts Unicode code points, so an emoji or other astral-plane character counts as one, not the two UTF-16 units that a naive length would give. Display width counts monospace columns the way an editor ruler or a terminal does: a tab is not one column, it advances to the next tab stop (the next multiple of the tab width you choose), East Asian and fullwidth characters and most emoji take two columns each, and combining accent marks and zero-width characters take none. Display width is the default the limit is checked against because that is what a max line length rule really limits. You set the limit directly or with one click from presets that match the conventions people use: 72 columns for the body of a Git commit message, 79 for Python under PEP 8, 80 for Prettier and many C and Go style guides, and 100 or 120 for teams that prefer wider lines. You also pick the tab width (2, 4, or 8) used when expanding tabs for the display-width measure. The summary shows the total line count, the longest and shortest lines with their line numbers, the average width, the number of lines over the limit, and how many lines have trailing whitespace. A ruler view draws the longest line against a column scale with the over-limit portion highlighted in red and tabs and spaces made visible, so you can see exactly where it overflows. A sortable, scrollable table lists every offending line with its measured width, how far over it is, and a preview of the text, and you can copy just the line numbers (handy for jumping to them in your editor) or copy a full plain-text report. Typical uses include checking code against a linter's max-line-length rule before committing, finding the one stray line that fails CI, keeping documentation and comments inside a wrapping width, sizing translated UI strings and subtitle lines, and reviewing pasted text for lines that are too wide to read comfortably. Everything runs locally in your browser as you type, so the text or code you paste is never uploaded, logged, or stored.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsText Tools