Case Converter

Title, sentence, camel, snake, kebab and constant case in one click.

Your text Converted as you type
Title Case

          
Characters
0
Without spaces
0
Words
0
Lines
0

Words are counted the way the identifier cases split them, so getUserById reads as four words and version2 as two. The four layout cases do not split anything.

Every case at once

previews trimmed · copy takes the whole text

    Rules

    Two rules run under this switch: a capital after the first letter of a word, and a word in capitals sitting in a line that is not all capitals. Turn it off when the capitals arrived from a style guide rather than from a name, and every word converts.

    Where the rules run out

    • Proper nouns. Title case cannot tell a name from a common noun. It gives van der berg as Van Der Berg, which is not how that name is written.
    • Scripts without case. Capitalisation is a Latin, Greek and Cyrillic idea. Chinese, Japanese, Arabic and Hebrew text passes through every one of these conversions unchanged.
    • Turkish. Turkish has two lowercase i's. The dotted one uppercases to İ in Turkish and to I everywhere else, and the browser applies the everywhere-else rule, so istanbul comes back as ISTANBUL.
    • German ß. ß uppercases to SS, so straße becomes STRASSE — one character longer than it started. The character count changes with it, and nothing reverses that automatically.

    Upper case uppercases meaning, not only letters. Run over a whole document it flattens every word that carried information in its capitalisation: index.html becomes INDEX.HTML, README.md becomes README.MD, getUserById() becomes GETUSERBYID(). The letters are all still there; the words are not. Lowercasing afterwards will not put the boundaries back, and a file renamed this way stops matching the import that points at it on any filesystem that cares about case. Use UPPER to shout at a reader, not to rename a file.

    Nothing in the string says where the words are

    Converting to snake or kebab case means finding the boundaries, and an identifier does not carry them — the capitals are the only clue there is. Two rules read them:

    getUserById   -> get_user_by_id
            a capital that follows a lowercase letter starts a word
    
          HTTPServer    -> http_server
            a run of capitals followed by a capital and a lowercase
            letter splits before that last capital, so the acronym
            stays whole
    
          userid        -> userid
            no capitals and no separators. There is nothing to read,
            and no rule can tell whether that is "user id" or one word.
            Every tool that guesses here is guessing.

    The third case is the one worth remembering, because it is where a converter quietly produces something wrong rather than something odd. A name written entirely in lowercase arrived that way for a reason — it is a package name, a plugin slug, a word that was already one word — and the only way to split it is a dictionary of the language's words, which is a different tool with a different failure rate. Where the boundaries matter and the capitals are gone, the answer is a rename in the source rather than a conversion here.

    The same reading explains what happens at the ends of a name. A leading capital is a boundary whether or not anything precedes it, a trailing digit is usually part of the word before it, and a name that already mixes conventions — an underscore in one place and a capital in another — comes out joined consistently, which is the point. The converter is not preserving your intent; it is applying one reading of the capitals and joining the pieces the way the target convention wants.

    Case is information, and the conversions are one-way. Lowercasing throws away the record of which letters were capitals, and nothing in the result says it was ever getUserById. Words that depend on an interior capital — iPhone, McDonald, a family name with a particle — lose it on the first pass and get it back wrong on the second. The pane you typed in is never written over, so the original stays on screen; convert a copy, and keep the copy you care about outside the tool.

    Title case is a style, not a rule

    Which words stay lowercase in a title is decided by a style guide, and the guides disagree. The short list everyone half-remembers — the articles, the conjunctions and the short prepositions — is broadly shared, but where a guide draws the line between a short preposition and a long one varies, and so does whether a verb like is counts as a small word. Nothing about the text says which guide it is being held to, so the tool picks one and applies it consistently.

    Two decisions inside that are worth knowing about, because both produce a result that looks like a bug and is not. A hyphenated compound is converted part by part, so each half is capitalised as a word in its own right. And a full stop is read as the end of a sentence wherever it appears, which means a filename in a title comes out with its extension capitalised — there is nothing in a string of characters that distinguishes the dot that ends a sentence from the dot that separates a name from its type. A title containing a filename is better handled by converting the words and typing the name back in.

    The choice between Title Case and sentence case for headings is a house decision rather than a correctness one, and the thing readers notice is the inconsistency rather than the choice. One level of heading in Title Case and the next in sentence case reads as an oversight even when both are defensible on their own. Pick one, write it into the style notes, and let the converter do the mechanical part.

    Where case does not exist

    Case is a property of some writing systems and not others. Chinese, Japanese, Korean, Arabic, Hebrew, Thai and Devanagari have no upper and lower forms at all, so a conversion over text in any of them returns the text unchanged — not a failure, and not something to work around. A string that mixes scripts has a title case in the Latin part and nothing to do in the rest, which is why a translated heading can look half-converted when it has been handled correctly.

    Where the scripts do have case, the mapping is not always one character to one character. The German ß uppercases to SS, two characters where there was one, so an uppercase conversion can lengthen a string — and a length limit, a column width or a filename that fitted before now does not. Accented Latin letters convert cleanly, with é becoming É and back, but a few languages apply rules of their own rather than the Unicode defaults, and a converter that does not know which language it is reading cannot tell.

    The practical consequence is that comparing two strings case-insensitively is a language question rather than a byte question, and a name that differs from another only in case is best avoided altogether. Where a renamed file or a re-cased identifier has to be checked against something else that reads it, the Diff Checker will show the two versions side by side and the JSON Formatter will confirm a payload still parses after its keys were changed.

    Reference

    Which case belongs where

    ConventionExampleWhere it normally livesWhat breaks if you use it elsewhere
    snake_caseuser_account_idPython names, SQL columns, config keysJavaScript style guides flag it, and a JSON API that expects camelCase keys needs a mapping step
    kebab-casemain-nav-itemCSS class names, HTML attributes, URL slugsIt cannot be an identifier in most programming languages, because a hyphen is a minus sign
    camelCasegetUserByIdJavaScript and Java variables and methods, JSON keysA database folds an unquoted identifier to one case, so a column named this way has to be quoted
    PascalCaseInvoiceLineItemClass names, component names, type namesA URL path is case-sensitive, so a slug written this way fails for anyone who types it in lowercase
    SCREAMING_SNAKE_CASEMAX_RETRY_COUNTConstants, and environment variablesOn Windows an environment variable name is case-insensitive and on Linux it is not, so the same name is a different variable on another machine
    lowercase with no separatoruseraccountFile and folder names, package namesNothing marks where a word ends, so a long name has to be read one letter at a time
    Title CaseQuarterly Revenue ReportHeadings, page titles, button labels, email subjectsIt is never a valid code identifier: a name containing spaces is a syntax error in most languages
    Sentence caseA note on the quarterly reportBody copy, interface text, documentation headings in several style guidesNothing breaks technically, but switching between it and Title Case for one level of heading is what readers notice

    Read the last column as the warning label on each row: a convention is right in the layer it was designed for and expensive outside it. Sentence case is the one row here that is a writing decision rather than a naming one.

    The layer decides the casing, not the preference. A URL is parsed by a server, a column is read by a query planner and a variable is read by a compiler, and each expects a different shape. That is why one project correctly holds kebab-case URLs, snake_case database columns and camelCase variables at the same time without anyone being inconsistent.

    A mixture inside one layer is the thing that costs real time. Half a table in snake_case and half in camelCase means every query is written by looking the names up instead of knowing the pattern, and each new file is a fresh coin flip. When a codebase is going to be fixed, fix one layer per pass and finish it, because a half-converted layer takes longer to read than a consistently wrong one.

    One trap survives all of that. A rename that changes only letter case appears to do nothing on Windows and macOS, because both filesystems are case-insensitive by default: the old name and the new one are the same name to the system, so the change can be skipped. Rename to a temporary name first if you need to move a file across case. Treat every name as if case mattered, and never keep two names in one folder that differ only in case.

    Questions

    Cases, answered plainly

    What counts as a short word in Title case?

    a, an, the, and, but, or, for, nor, on, at, to, of, in, by — the articles, conjunctions and prepositions that carry no stress in a spoken sentence. One of them stays lowercase only while it sits in the middle. The first word, the last word, and any word starting a sentence after a full stop, a colon or a line break are all capitalised, so the end of the affair becomes The End of the Affair and a tale of two cities becomes A Tale of Two Cities.

    Why did my acronym come back as Nasa?

    An all-caps word is kept when the line around it has ordinary lowercase in it, because that is what an acronym looks like in a sentence: the NASA probe gives The NASA Probe. A line that is nothing but capitals is read as shouting instead, so NASA on a line of its own comes back as Nasa. Put one lowercase word on the same line, or use UPPER, if the capitals matter.

    Why does HTTPResponse become http_response?

    The identifier cases lowercase everything and rebuild the word boundaries themselves. A run of capitals followed by a capital and a lowercase letter reads as two words, so HTTPServer gives http_server and HTTPResponse gives http_response. NASA on its own has no boundary to find and lowercases whole. If the capitals are part of the name, convert with UPPER or leave that row alone.

    What happens to accented letters?

    Nothing is stripped. é uppercases to É, ü to Ü, and the rest of Latin-1 and Latin Extended-A behave the same way, so Zürich converts to ZÜRICH and reverses cleanly. Turkish is the exception worth knowing: its dotted and dotless i follow their own rules, and the browser applies the Unicode defaults instead.

    Can I get the original capitals back afterwards?

    Only if you kept them. Lowercasing throws away the record of which letters were capitals, and getuserbyid contains no clue that it was ever getUserById. Upper case loses the same thing in the other direction. The pane you typed in is never written over, so the original is still on screen to copy from while the tab is open, and that is the copy to keep if the casing matters.

    Does anything I paste get kept?

    There is no account, no upload step and no history that outlives the tab. Paste a contract clause in and the only copy left after you close it is the one on the clipboard, put there by the copy button you pressed. That is not a promise about policy, it is what the code does: the conversion is string arithmetic on characters that are already on the screen.

    Why did my rename not change anything?

    Windows and macOS both treat File.txt and file.txt as the same file, because their filesystems are case-insensitive by default. A rename that only changes the case of the letters is a rename to the same name, so the system can ignore it and the file keeps its old spelling. Rename it to a temporary name such as temp.txt first, and then to the name you want. Two files in one folder whose names differ only in case will collide the first time they are copied to a case-sensitive disk, so keep only one of them.

    Can I use spaces in a filename?

    Yes, and the file works normally until something else has to name it. A space splits a path into separate arguments in a shell command unless the whole path is quoted, has to be written as %20 in a URL, and breaks build scripts and import lines that expect a single token. A separator such as a hyphen or an underscore keeps the readability and removes the quoting, which is why most projects use one.

    How do I convert a whole list of names at once?

    Paste one name per line. Title and Sentence case leave the line breaks where they are, so a list comes back as a list with one converted name on each line. The identifier cases do not: they read the whole box as one run of words and join them, so a column of names pasted in comes back as a single string joined by underscores or hyphens, with the line breaks gone. If you need each name on its own line in snake or camel case, convert them one at a time.