Text Case Converter
15 case transformations with intelligent tokenization — camelCase, PascalCase, snake_case, Title Case & more
Launch Text Case Converter →
Table of Contents
Overview
The Text Case Converter is a comprehensive text transformation tool that provides 15 distinct case styles -- covering natural language conventions, programming naming standards, and decorative character effects. At its core lies an intelligent tokenization engine built from a 5-step regex pipeline that can decompose any input format -- whether it is a camelCase variable name, an HTTPS_CONNECTION constant, a hyphenated-slug, or a dot.separated.path -- into clean word tokens that are then reassembled in your chosen case style. Every conversion happens in real time on every keystroke, with no debounce delay, and the entire tool runs in pure client-side JavaScript with zero external libraries.
Beyond simple case switching, the converter includes abbreviation-aware sentence counting that recognizes over 30 common abbreviations (Mr., Dr., Inc., U.S., Jan.–Dec.) and prevents their trailing periods from creating false sentence boundaries. Statistics for characters, words, sentences, and lines update live as you type. You can upload files in 16 code and text formats up to 5MB, copy output with a Ctrl+Enter keyboard shortcut, and download transformed text with automatically generated filenames that reflect the chosen case style.
Whether you are refactoring variable names across a codebase, preparing editorial headlines with proper title casing, converting database column names between snake_case and camelCase, or simply toggling text between uppercase and lowercase, the Text Case Converter handles it all in a single unified interface with zero data transmission and complete privacy.
Key Features
15 Case Transformations
UPPERCASE, lowercase, Title Case, Sentence case, Capitalize Words, camelCase, PascalCase, snake_case, kebab-case, dot.case, path/case, CONSTANT_CASE, Train-Case, Alternating case, and Inverse/Toggle -- covering natural language, programming conventions, and decorative styles.
Intelligent Tokenization
A 5-step regex pipeline that handles any input format: camelCase boundary detection (/([a-z])([A-Z])/g), acronym splitting (HTTPSConnection → HTTPS Connection), separator normalization (_-./\ → spaces), punctuation removal, and whitespace splitting with empty token filtering.
Programming Convention Support
JavaScript (camelCase), Python (snake_case), CSS (kebab-case), Java (camelCase/PascalCase), Rust (snake_case), Go (camelCase), SQL (CONSTANT_CASE), URLs (kebab-case) -- paste identifiers in any format and convert to your target language’s convention instantly.
Title Case with 24 Small Words
Articles, prepositions, and conjunctions -- a, an, and, as, at, but, by, for, if, in, nor, of, on, or, so, the, to, up, yet, is, it, vs, via -- stay lowercase except when they appear as the first word on a line. Proper editorial title casing.
Abbreviation-Aware Statistics
Over 30 abbreviations (Mr., Mrs., Ms., Dr., Prof., Sr., Jr., St., Gen., Gov., Inc., Ltd., Corp., Jan.–Dec., U.S., U.K., D.C.) are pre-processed before sentence counting, preventing false boundaries from abbreviated periods.
Real-Time Preview
Every keystroke converts instantly across all 15 styles with no debounce delay. Character count, word count, abbreviation-aware sentence count, and line count update live with singular/plural labels.
File Upload
16 code and text formats supported: .txt, .csv, .json, .md, .html, .js, .ts, .py, .css, .sql, .yaml, .yml, .ini, .cfg, .env, .xml, .log. Maximum file size: 5MB.
Keyboard Shortcuts
Ctrl+Enter copies the output to your clipboard instantly. One-click tag buttons switch between all 15 transformations. Copy and download buttons with Clipboard API and execCommand fallback for maximum browser compatibility.
All 15 Transformations
The 15 case styles are organized into three categories based on how they process input text. Understanding these categories is essential for choosing the right transformation for your use case.
Natural Language Cases (Line-by-Line Processing)
These five cases process text line by line, preserving the overall structure of your input including line breaks, punctuation, and spacing. They operate on whole text rather than tokenized words.
- UPPERCASE — Applies
toUpperCase()to the entire text. All alphabetic characters become uppercase while numbers, symbols, and whitespace are preserved exactly as entered. Example:hello world→HELLO WORLD - lowercase — Applies
toLowerCase()to the entire text. The inverse of UPPERCASE. Example:Hello World→hello world - Title Case — Capitalizes the first letter of each word and lowercases the rest, except for 24 small words (a, an, and, as, at, but, by, for, if, in, nor, of, on, or, so, the, to, up, yet, is, it, vs, via) which remain lowercase unless they are the first word on a line. Each word is processed as
charAt(0).toUpperCase() + slice(1).toLowerCase(). Example:the quick brown fox and the lazy dog→The Quick Brown Fox and the Lazy Dog - Sentence case — Lowercases the entire text first, then capitalizes the first letter after line starts (
^\s*) and sentence boundaries ([.!?]\s+). Processed line by line to ensure each line begins with a capital letter. Example:hello world. goodbye world.→Hello world. Goodbye world. - Capitalize Words — Capitalizes only the first character of each word using the regex pattern
(^|\s)(\S), leaving the rest of each word completely unchanged from the original input. This is the critical difference from Title Case: Title Case lowercases the remainder of each word, while Capitalize Words preserves the original casing of every character after the first. Example:hELLO wORLD→HELLO WORLD(Title Case would produceHello World).
Programming Naming Conventions (Tokenized, Line-by-Line)
These eight cases first pass each line through the tokenization engine to extract clean word tokens, then reassemble them using the target convention’s separator and casing rules. This is what makes the converter so powerful for programming: you can paste a camelCase variable and instantly get its snake_case equivalent without manual editing.
- camelCase — First word is all lowercase; subsequent words have
charAt(0).toUpperCase() + slice(1).toLowerCase(); no separators between words. Example:my variable name→myVariableName - PascalCase — Every word has
charAt(0).toUpperCase() + slice(1).toLowerCase(); no separators. Differs from camelCase only in that the first letter is capitalized. Example:my variable name→MyVariableName - snake_case — All words lowercased, joined by underscores (
_). The standard Python naming convention. Example:myVariableName→my_variable_name - kebab-case — All words lowercased, joined by hyphens (
-). Used in CSS class names, URL slugs, and HTML attributes. Example:myVariableName→my-variable-name - dot.case — All words lowercased, joined by dots (
.). Common in Java package names, configuration file keys, and object property paths. Example:myVariableName→my.variable.name - path/case — All words lowercased, joined by forward slashes (
/). Useful for constructing URL paths and file system paths. Example:myVariableName→my/variable/name - CONSTANT_CASE — All words uppercased, joined by underscores (
_). Also known as SCREAMING_SNAKE_CASE. The universal convention for constants in nearly every programming language. Example:myVariableName→MY_VARIABLE_NAME - Train-Case — Each word has
charAt(0).toUpperCase() + slice(1).toLowerCase(), joined by hyphens (-). A hybrid of Title Case and kebab-case. Used in HTTP headers (e.g.,Content-Type,X-Request-Id). Example:myVariableName→My-Variable-Name
Character-by-Character Cases (Counter Spans Entire Text)
These two cases operate character by character across the entire input text, not line by line. Their counters and logic span the full text without resetting at line boundaries.
- Alternating case — A counter increments only for alphabetic characters. Even-indexed characters (0, 2, 4, ...) become lowercase; odd-indexed characters (1, 3, 5, ...) become uppercase. Non-alphabetic characters (spaces, punctuation, numbers) pass through without incrementing the counter. Example:
hello, world!→hElLo, WoRlD!— note how the comma and space do not affect the alternation pattern. - Inverse/Toggle — Swaps the case of every alphabetic character individually: uppercase becomes lowercase, lowercase becomes uppercase. Non-alphabetic characters are unchanged. Applying Inverse twice returns the original text exactly. Example:
Hello World→hELLO wORLD
The Tokenization Engine
The tokenization engine is the heart of the Text Case Converter. It is responsible for decomposing any input string -- regardless of its original format -- into a clean array of word tokens that can then be reassembled in the target case style. All eight programming naming convention cases depend on this engine. The engine is a 5-step regex pipeline applied sequentially:
Step 1: camelCase Boundary Detection
.replace(/([a-z])([A-Z])/g, '$1 $2')
This regex finds transitions from a lowercase letter to an uppercase letter and inserts a space between them. It is what allows the tokenizer to split camelCase and PascalCase identifiers into their constituent words.
myVariableName→my Variable NamegetElementById→get Element By IdparseJSON→parseJ SON(partially split -- Step 2 finishes the job)
Step 2: Acronym Splitting
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
This regex handles runs of consecutive uppercase letters (acronyms) followed by an uppercase letter and a lowercase letter (start of a new word). It inserts a space before the last uppercase letter that begins the new word, keeping the acronym intact.
HTTPSConnection→HTTPS Connection(after Step 1:HTTPSC onnection→ after Step 2:HTTPS Connection)XMLHttpRequest→XML Http RequestgetURLParser→get URL ParserIOStream→IO Stream
Step 3: Separator Normalization
.replace(/[_\-./\\]+/g, ' ')
This regex converts all common programming separators -- underscores (_), hyphens (-), dots (.), forward slashes (/), and backslashes (\) -- into spaces. One or more consecutive separators become a single space, preventing empty tokens.
my_variable_name→my variable namekebab-case-name→kebab case namecom.example.app→com example appsrc/utils/helpers→src utils helpersmy__double___sep→my double sep(consecutive separators collapsed)
Step 4: Punctuation Removal
.replace(/[^\w\s]/g, ' ')
This regex replaces any remaining non-word, non-whitespace characters (punctuation, special symbols, brackets, quotes) with spaces. After Steps 1–3 have handled the structured separators, this step catches everything else.
hello@world→hello worldprice$100→price 100array[0]→array 0
Step 5: Whitespace Splitting and Filtering
.trim().split(/\s+/).filter(Boolean)
The final step trims leading and trailing whitespace, splits on one or more whitespace characters, and filters out any empty strings that might result from edge cases. The output is a clean array of word tokens ready for reassembly.
my Variable Name→['my', 'Variable', 'Name']HTTPS Connection→['HTTPS', 'Connection']extra spaces→['extra', 'spaces']
Complete Pipeline Examples
Here is what the full 5-step pipeline produces for various real-world inputs:
myVariableName→['my', 'variable', 'name']— camelCase boundaries detected in Step 1HTTPSConnection→['HTTPS', 'connection']— acronym preserved by Step 2my_var-name.dot/path\back→['my', 'var', 'name', 'dot', 'path', 'back']— all separators normalized in Step 3XMLHttpRequest→['XML', 'Http', 'Request']— two acronym boundaries resolvedgetURLParser→['get', 'URL', 'Parser']— mixed camelCase and acronymIOStream→['IO', 'Stream']— two-letter acronym correctly preserveduser123name→['user123name']— numbers are preserved as part of tokens
Programming Language Guide
Every programming language and framework has its own naming conventions. Using the wrong case style marks your code as non-idiomatic and can cause issues with case-sensitive systems (like file imports on Linux). Here is a comprehensive guide to which case style each language expects:
JavaScript / TypeScript
- Variables and functions:
camelCase—getUserName,isLoading,fetchData - Classes and components:
PascalCase—UserProfile,HttpClient,EventEmitter - Constants:
CONSTANT_CASE—MAX_RETRIES,API_BASE_URL,DEFAULT_TIMEOUT - File names (React):
PascalCasefor component files —UserProfile.tsx - CSS modules:
camelCasewhen imported —styles.headerContainer
Python
- Variables and functions:
snake_case—get_user_name,is_loading,fetch_data - Classes:
PascalCase—UserProfile,HttpClient,EventEmitter - Constants:
CONSTANT_CASE—MAX_RETRIES,API_BASE_URL - Modules and packages:
snake_case—my_module,data_utils - Convention source: PEP 8 — the official Python style guide
Java
- Variables and methods:
camelCase—getUserName(),isLoading - Classes and interfaces:
PascalCase—UserProfile,Serializable - Constants:
CONSTANT_CASE—MAX_CONNECTIONS,DEFAULT_PORT - Packages:
dot.case(lowercase) —com.example.myapp
C# / .NET
- Public methods and properties:
PascalCase—GetUserName(),IsLoading - Private fields:
camelCasewith underscore prefix —_userName,_isLoading - Constants:
PascalCase(not CONSTANT_CASE) —MaxRetries,DefaultTimeout - Interfaces:
PascalCasewith I prefix —IDisposable,IEnumerable
Rust
- Variables and functions:
snake_case—get_user_name,is_loading - Types, structs, enums:
PascalCase—UserProfile,HttpClient - Constants:
CONSTANT_CASE—MAX_RETRIES,DEFAULT_PORT - Modules and crates:
snake_case—my_module,data_utils
Go
- Exported (public) names:
PascalCase—GetUserName,HttpClient - Unexported (private) names:
camelCase—getUserName,httpClient - Constants:
PascalCaseorcamelCase(matching export visibility) - Acronyms: All caps within identifiers —
HTTPSConnection,XMLParser,userID
CSS / SCSS
- Class names:
kebab-case—.user-profile,.nav-container - IDs:
kebab-case—#main-content,#sidebar-toggle - Custom properties:
kebab-case—--primary-color,--font-size-lg - BEM methodology:
kebab-casewith block__element--modifier —.card__title--active
SQL
- Table names:
snake_caseorPascalCase(varies by team) —user_profiles - Column names:
snake_case—first_name,created_at - Constants and keywords:
CONSTANT_CASE(uppercase) —SELECT,INSERT INTO
URLs and Slugs
- URL paths:
kebab-case—/user-profile/edit-settings - File paths:
path/case—src/utils/helpers - SEO slugs:
kebab-case—how-to-convert-text-case
HTTP Headers
- Header names:
Train-Case—Content-Type,X-Request-Id,Cache-Control,Accept-Encoding
How to Use
- Open the Text Case Converter — Launch the tool and type or paste your text into the input area. The tool accepts any text: natural language sentences, programming identifiers, file paths, mixed-format content, or even full code files.
- Click Any of the 15 Case Tag Buttons — Choose from UPPERCASE, lowercase, Title Case, Sentence case, Capitalize Words, camelCase, PascalCase, snake_case, kebab-case, dot.case, path/case, CONSTANT_CASE, Train-Case, Alternating, or Inverse. The active button is highlighted, and the output updates instantly.
- View Live Statistics — Below the input area, four counters update in real time: character count (
text.length), word count (whitespace-split), sentence count (abbreviation-aware, preventing false boundaries from Mr., Dr., Inc., etc.), and line count. Labels automatically switch between singular and plural. - Convert Programming Identifiers — For variable names in any format, paste them directly. The tokenizer handles camelCase (
myVar), snake_case (my_var), kebab-case (my-var), dot.case (my.var), PascalCase (MyVar), CONSTANT_CASE (MY_VAR), and even mixed formats with acronyms (HTTPSConnection,XMLHttpRequest). - Upload a Code File — Click the upload button to load a file in any of 16 supported formats:
.txt,.csv,.json,.md,.html,.js,.ts,.py,.css,.sql,.yaml,.yml,.ini,.cfg,.env,.xml, or.log. Maximum size: 5MB. The file contents are read entirely by your browser. - Copy or Download Output — Press Ctrl+Enter to copy the output directly to your clipboard, or use the copy and download buttons. Downloaded files use a
filename-{case}.txtnaming pattern so you can easily identify which transformation was applied. - Switch Between Transformations Freely — Your input text stays exactly as you entered it. Only the output changes when you click a different case tag button, so you can quickly compare how your text looks in different case styles without retyping anything.
Frequently Asked Questions
/([a-z])([A-Z])/g with the replacement '$1 $2'. This detects every transition from a lowercase letter to an uppercase letter and inserts a space between them. For example, myVariableName becomes my Variable Name, which then splits into the tokens ['my', 'Variable', 'Name']. This same regex handles PascalCase identifiers as well -- MyVariableName becomes My Variable Name. The key insight is that camelCase boundaries are always marked by a lowercase-to-uppercase transition, making this regex pattern reliable for any well-formed identifier./([A-Z]+)([A-Z][a-z])/g with replacement '$1 $2'. This regex looks for a run of uppercase letters ([A-Z]+) followed by an uppercase letter and a lowercase letter ([A-Z][a-z]), which signals the start of a new word. It inserts a space before that last uppercase letter. So HTTPSConnection first becomes HTTPSC onnection after Step 1 (lowercase-to-uppercase detection), then Step 2 corrects this to HTTPS Connection. The acronym HTTPS is preserved intact as a single token. Other examples: XMLHttpRequest → XML Http Request, getURLParser → get URL Parser, IOStream → IO Stream.charAt(0).toUpperCase() + slice(1).toLowerCase() to every word -- meaning it capitalizes the first letter AND lowercases everything after it. It also keeps 24 small words (a, an, the, etc.) in lowercase. Capitalize Words only uppercases the first character of each word and leaves every other character completely unchanged from the original input. Example with input hELLO wORLD: Title Case produces Hello World (rest lowercased), while Capitalize Words produces HELLO WORLD (rest preserved as-is). Use Title Case for proper editorial headings; use Capitalize Words when you want to preserve existing casing while ensuring each word starts with a capital.·) placeholder character before the sentence boundary regex runs. This prevents "Dr. Smith went to St. Louis." from being counted as 3 sentences -- it correctly counts as 1 sentence because only the final period is a real sentence boundary. The middle dot placeholders are internal only and do not appear in any output.getUserData, isValid, handleClick), PascalCase for class names and React component names (UserProfile, EventEmitter, NavigationBar), and CONSTANT_CASE for constants that should never change (MAX_RETRIES, API_BASE_URL, DEFAULT_TIMEOUT). For TypeScript, the same conventions apply: interfaces and type aliases also use PascalCase (UserProps, ApiResponse). If you are working with CSS modules in a JavaScript project, class names imported as JavaScript properties are typically accessed in camelCase (styles.headerContainer).get_user_data, is_valid, handle_click), PascalCase for class names (UserProfile, HttpClient), CONSTANT_CASE for module-level constants (MAX_RETRIES, BASE_URL), and snake_case for module and package names (my_module, data_utils). Private attributes conventionally use a leading underscore (_internal_value), and name-mangled attributes use a double leading underscore (__private_attr). Python’s linting tools (pylint, flake8, ruff) will flag identifiers that violate these conventions..txt (plain text), .csv (comma-separated values), .json (JSON data), .md (Markdown), .html (HTML), .js (JavaScript), .ts (TypeScript), .py (Python), .css (CSS stylesheets), .sql (SQL queries), .yaml and .yml (YAML configuration), .ini and .cfg (configuration files), .env (environment variables), .xml (XML data), and .log (log files). The maximum file size is 5MB. Files are read entirely by your browser using the FileReader API -- the contents are loaded directly into the input area without any server contact..replace(), character code inspection with toUpperCase() and toLowerCase(), array manipulation with .split(), .map(), .join(), and .filter(). The tool uses zero external libraries -- no CDN scripts, no npm packages, no WebAssembly, nothing loaded from any third-party server. There are no API calls, no fetch requests, no WebSocket connections, no server-sent events. Your text, variable names, code snippets, and uploaded files are processed entirely by your browser’s JavaScript engine. The data exists only in your browser’s memory and is discarded when you close or refresh the page. No data is ever written to localStorage, cookies, or IndexedDB.Privacy & Security
Text case conversion involves pure string manipulation -- regex pattern matching, character code arithmetic, and array operations. The tokenization engine is a 5-step regex pipeline executed entirely in your browser. No external APIs are called, no server-side processing occurs, and no third-party libraries are loaded. Your text, code, variable names, and uploaded files are processed entirely by your browser’s JavaScript engine and never leave your device. There are no network requests beyond the initial page load. The tool does not use localStorage, cookies, or any form of persistent storage -- when you close the tab, your data is gone. You are in complete control of your data at all times.
Ready to transform your text? The Text Case Converter is free, private, and runs entirely in your browser.
Launch Text Case Converter →Related
Last Updated: March 26, 2026