Text Case Converter
Convert text between different case formats instantly.
The Text Case Converter transforms one input into twelve case styles at once: UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case, path/case, and Toggle Case. Type into "Input Text", click any of the case buttons to fill the readonly "Result" textarea, and — more usefully — every one of the twelve conversions also renders as a clickable chip below, each ready to copy with a green Check and a "Copied to clipboard!" toast.
The StepIndicator shows Input → Convert, and the chips stay precomputed so comparing variants never means re-clicking twelve buttons. Share packs your text into a URL hash (toast "Link copied!") and shared links restore the input on mount via decodeToolConfig('case-converter'); Clear resets text, result, and the copied indicator with "Cleared!". Word splitting handles camelCase boundaries and non-alphanumeric separators, so foo-bar converts as "Foo Bar" in Title Case. Everything runs locally — no network.
How it works
lib/caseConverter.ts convertCase is a switch over the twelve styles: uppercase/lowercase use native methods; title capitalizes via /\b\w/g; sentence capitalizes after ^\s*|[.!?]\s+; camel and Pascal route through toCamelCase, which first splits existing camelCase boundaries and replaces non-alnum runs with spaces; snake/kebab/constant/dot/path join those words with their separators; toggle flips each character's case.
The shared word tokenizer inserts a space before capitals with ([a-z])([A-Z]) and replaces non-alphanumeric runs with spaces, which is why hyphenated and path inputs tokenize correctly. The Redux slice holds text and converted state; chips precompute convertCase(text, value) for every CASE_TYPES entry. Share and restore use copyShareableUrl('case-converter', { text }) with a hash decode on mount — all client-side.
How to use
- On Step "Input", type or paste text into "Input Text" (placeholder "Type or paste your text here...").
- Click any of the twelve case buttons (enabled only when the input is non-empty): UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case, path/case, Toggle Case.
- Read the chosen conversion in the readonly "Result" textarea.
- Below, click any of the twelve result chips to copy that variant — a green Check marks the copied chip alongside the "Copied to clipboard!" toast.
- Click "Share" to copy a URL containing your text (toast "Link copied!" or "Failed to copy link").
- Reopen a shared link — the input restores on mount via decodeToolConfig('case-converter').
- Click "Clear" to reset text, converted output, and the copied indicator (toast "Cleared!").
Tips
- Result chips pre-compute all twelve variants (convertCase per CASE_TYPES) so one click copies any style without touching the main buttons.
- camelCase splits on existing camel boundaries and non-alphanumeric characters before rejoining — mixed inputs like "hello_world" become "helloWorld".
- Toggle Case swaps upper/lower per character — handy for fixing caps-lock accidents like "hELLO" → "Hello".
- Title Case splits on non-alnum, so "foo-bar" becomes "Foo Bar" rather than keeping the hyphen glued to a lowercase letter.
Text Case Converter FAQ
How many case styles does it support?
Twelve — the full CASE_TYPES list: UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case, path/case, and Toggle Case.
Does Title Case handle hyphenated words?
Words are split on non-alphanumeric characters, so "foo-bar" becomes "Foo Bar".
Is Share a server feature?
No — it uses copyShareableUrl to encode your text into the URL hash; restoring is decodeToolConfig on mount.
Are conversions live or on click?
Click a case button to fill the Result textarea; the chips always show all twelve variants precomputed, so they update with the input too.
Credits
- In-repo convertCase — Case algorithms in lib/caseConverter.ts; no external dependency