What does this tool do
The Text Case Converter changes the case of text in two ways. Predefined mode: one-click conversion of the entire text to uppercase, lowercase, title case, sentence case, camelCase, PascalCase, snake_case, kebab-case, or CONSTANT_CASE. Regex mode: apply a case transformation (uppercase, lowercase, or title) only to text that matches a regular expression; non-matching text stays unchanged. Useful for formatting headings, converting identifiers, normalising data, or selectively transforming parts of text (e.g. uppercase acronyms only).
How to use it
Predefined mode
- Select mode — Choose "Predefined".
- Enter text — Paste or type the text to convert.
- Select preset — Click a preset (UPPERCASE, lowercase, Title Case, etc.).
- Copy result — The output updates live; copy when done.
Regex mode
- Select mode — Choose "Regex".
- Enter text — Paste or type the text to process.
- Use presets or add patterns — Click a regex preset (e.g. "Lowercase words → UPPERCASE", "All words → Title case") to apply a pattern+case combination instantly, or enter one or more regex patterns manually. Each pattern is applied in order (output of rule 1 becomes input to rule 2). Use "Add pattern" to add more rules.
- Choose case per rule — Each rule has its own case mode (uppercase, lowercase, title, camelCase, etc.).
- Set flags — Toggle global (g), case-insensitive (i), multiline (m), dot-all (s) as needed. Flags are shared across all rules.
- Copy result — Output updates live; invalid pattern shows an inline error under the failing rule.
How it works
Predefined mode: The input is transformed according to the selected case. Word boundaries for title and sentence case use whitespace; camelCase and snake_case split on spaces, hyphens, and underscore/camel boundaries. Regex mode: One or more regex patterns can be applied sequentially. Each rule specifies a pattern and a case mode; output of rule N becomes input to rule N+1. Patterns are validated with new RegExp() before use. If valid, each match is replaced with the same text in that rule's chosen case; everything else is unchanged. On the first validation or runtime error, the chain stops and shows the error under the failing rule. All processing runs client-side. No data is sent to any server.
Use cases & examples
- Format headings — Convert
MY HEADING→My Heading(title case). - Variable names — Convert
my variable name→myVariableName(camelCase) ormy_variable_name(snake_case). - Constants — Convert
api key→API_KEY. - Selective uppercase — Pattern
\b[A-Z]{2,}\bwith uppercase: keep acronyms like "HTML" and "API" in caps; lower-case the rest. - Sentence case — Capitalise only the first letter of each sentence.
- Normalise data — Convert column headers or identifiers to a standard format.
Example (Regex mode)
- Pattern
\b\w+\bwith title case → Capitalise every word. - Pattern
\b[A-Z]{2,}\bwith uppercase → Ensure acronyms stay uppercase (no change if already uppercase). - Pattern
\d+with lowercase → Matches digits; lowercase has no effect on digits; use to target specific segments.
Example (Multiple rules)
- Rule 1: Pattern
\b[A-Z]{2,}\bwith UPPERCASE → Keep acronyms like "HTML" and "API" in caps. - Rule 2: Pattern
\b[a-zA-Z]+\bwith lowercase → Convert remaining words to lowercase.
Limitations & known constraints
- Pattern validated first — Invalid regex shows an error; no transformation is run.
- ReDoS — Complex patterns on very long text may be slow; avoid catastrophic backtracking.
- JavaScript regex — Uses JS regex flavour; some PCRE features may differ.
- Identifier parsing — camelCase/snake_case assumes words are separated by spaces, hyphens, or underscores; mixed styles may produce unexpected results.
- Unicode — Case conversion uses JavaScript’s built-in methods; some locales may behave differently.