Layerbit
Runs entirely in your browser

Text Case Converter & Word Counter

Convert text or identifiers between camelCase, snake_case, kebab-case, Title Case and a dozen other styles, count words, characters, sentences and reading time as you type, and clean up lists with one click: sort, dedupe, trim and unwrap.

Text
Convert to
Counts & readability
Keywords & line tools
WordCountDensity

Naming conventions and where they are used

Programming languages and file formats each have a preferred way of joining words into a single identifier. Following the convention of the ecosystem you are in makes code easier to read and avoids linter warnings, and converting between them is a constant chore when data crosses a boundary: a JSON API in camelCase feeding a Python service in snake_case, or a database column becoming a CSS class.

StyleExampleConventional for
camelCaseuserAccountIdJavaScript and Java variables and functions, JSON keys from JS APIs
PascalCaseUserAccountIdClasses and types in most languages, C# methods and properties, React components
snake_caseuser_account_idPython, Ruby and Rust variables, PostgreSQL columns
CONSTANT_CASEUSER_ACCOUNT_IDConstants and environment variables everywhere
kebab-caseuser-account-idURLs, CSS classes, HTML attributes, CLI flags, npm package names
Train-CaseUser-Account-IdHTTP header names such as Content-Type
dot.caseuser.account.idConfiguration keys (Java properties, Spring), log field names

The converter splits input into words before joining them in the target style, and it understands the boundaries inside identifiers: XMLHttpRequest becomes XML · Http · Request, getUserID2FA becomes get · User · ID · 2 · FA, and underscores, hyphens, dots and spaces all count as separators. That is what lets it turn XMLHttpRequest into xml_http_request rather than x_m_l_http_request. Each line is converted separately, so a pasted column of field names converts as a column.

Title case rules

Title case is not simply capitalising every word. The major style guides, including AP and Chicago, keep short articles, conjunctions and prepositions lowercase unless they are the first or last word or follow a colon: "The Lord of the Rings: The Return of the King". This converter applies those rules, keeps acronyms such as NASA and API in capitals, and leaves words with deliberate inner capitals such as iPhone or McDonald untouched. Style guides differ on prepositions of four or more letters (Chicago lowercases "with", AP capitalises it), so check your house style for headlines that will be published. Sentence case, which capitalises only the first word and proper nouns, is the default for most UI text and is increasingly preferred for headings because it is easier to read.

URL slugs

The url-slug style produces lowercase words joined by hyphens with accents removed, the form search engines and humans read most easily in an address: "Crème Brûlée: A Beginner's Guide" becomes creme-brulee-a-beginners-guide. Accented letters are decomposed and their marks dropped, German ß becomes ss, and apostrophes disappear rather than splitting a word. Keep slugs short and stable; changing one later breaks every link to the old address unless you add a redirect.

How the counts are calculated

Character counts use grapheme clusters, what a reader perceives as one character, through the browser's Intl.Segmenter, so an emoji with a skin-tone modifier or a family emoji counts as one character, not four or eleven. The separate code-unit figure is what JavaScript's .length reports and what many databases and SMS limits count, and the byte figure is the UTF-8 size. Words are segmented with the same Unicode rules, which also handles languages written without spaces. Reading time uses 238 words per minute, the average for adult silent reading of non-fiction found in a 2019 meta-analysis by Brysbaert; speaking time uses 150 words per minute, a typical presentation pace. The Flesch reading-ease score is shown for English text; scores from 60 to 70 read as plain English, and higher is easier.

Frequently asked questions

Paste the identifiers into the text box, one per line, and copy the snake_case row from the list on the right, or select it and press Apply to text. The converter splits camelCase at each lower-to-upper transition and keeps runs of capitals together, so parseHTTPResponse becomes parse_http_response. It works the same way for PascalCase, kebab-case, dot.case and CONSTANT_CASE input.

Articles (a, an, the), coordinating conjunctions (and, but, or, nor, for, so, yet) and short prepositions (at, by, in, of, on, to, up, via, with and similar) stay lowercase unless they are the first word, the last word, or follow a colon. Everything else is capitalised. Acronyms written in capitals and words with internal capitals, such as iOS or YouTube, are left as typed.

Tools count different things. This one reports visible characters (grapheme clusters), so an emoji is one character, alongside the UTF-16 code units that JavaScript's length property and many form limits count, and the UTF-8 bytes a file or database column stores. A single flag emoji is 1 character, 4 code units and 8 bytes. If a limit is enforced by a system, check which of these it uses; Twitter/X, for example, uses its own weighted count.

The word count divided by a reading speed of 238 words per minute, the average for adults reading non-fiction silently according to a 2019 review of 190 studies. You can change the speed in the counts panel; technical material is often read at 150 to 200 words per minute. Speaking time uses 150 words per minute, a comfortable pace for a talk or a voice-over.

Yes. The line tools remove duplicate lines (keeping the first occurrence and the original order), remove blank lines, trim spaces, sort A to Z or Z to A, reverse the order, collapse repeated spaces, and join hard-wrapped lines back into paragraphs. Sorting is natural and case-insensitive, so item2 sorts before item10. Each tool changes the input text, and Undo restores the previous version.

No. Conversion, counting and keyword analysis run in JavaScript in this page using your browser's built-in Unicode support. Nothing is sent to a server, which you can confirm in the Network tab of your browser's developer tools, and the page works offline once loaded.

Changelog