← All Tools ZeroDataUpload Home
Aa

Text Case Converter

15 case transformations with intelligent tokenization — camelCase, PascalCase, snake_case, Title Case & more

Launch Text Case Converter →
Text Case Converter

Table of Contents

  1. Overview
  2. Key Features
  3. All 15 Transformations
  4. The Tokenization Engine
  5. Programming Language Guide
  6. How to Use
  7. Frequently Asked Questions
  8. Privacy & Security

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 (HTTPSConnectionHTTPS 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.

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.

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.

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.

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.

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.

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.

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.

Complete Pipeline Examples

Here is what the full 5-step pipeline produces for various real-world inputs:

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

Python

Java

C# / .NET

Rust

Go

CSS / SCSS

SQL

URLs and Slugs

HTTP Headers

How to Use

  1. 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.
  2. 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.
  3. 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.
  4. 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).
  5. 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.
  6. 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}.txt naming pattern so you can easily identify which transformation was applied.
  7. 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

How many case transformations are supported?
The Text Case Converter supports 15 distinct transformations organized into three categories. Natural Language (5): UPPERCASE, lowercase, Title Case, Sentence case, and Capitalize Words -- these operate on the text as-is, preserving structure. Programming Conventions (8): camelCase, PascalCase, snake_case, kebab-case, dot.case, path/case, CONSTANT_CASE, and Train-Case -- these tokenize the input first, then reassemble with the target convention’s rules. Decorative (2): Alternating case and Inverse/Toggle -- these transform character by character across the entire text.
How does the tokenizer handle camelCase input?
The tokenizer’s first step uses the regex /([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.
How does it handle acronyms like HTTPSConnection?
Acronyms are handled by the second step of the tokenization pipeline: the regex /([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: XMLHttpRequestXML Http Request, getURLParserget URL Parser, IOStreamIO Stream.
What are the 24 Title Case small words?
The 24 small words that remain lowercase in Title Case are: a, an, and, as, at, but, by, for, if, in, nor, of, on, or, so, the, to, up, yet, is, it, vs, via. These include articles (a, an, the), coordinating conjunctions (and, but, for, nor, or, so, yet), short prepositions (as, at, by, in, of, on, to, up, via, vs), and common short verbs (is, it). The first word on each line is always capitalized regardless of whether it appears in the small word list. This follows standard editorial title casing conventions used by the Associated Press (AP), Chicago Manual of Style, and APA guidelines.
What is the difference between Title Case and Capitalize Words?
The difference is in how they treat the non-first characters of each word. Title Case applies 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.
How does abbreviation-aware sentence counting work?
The sentence counter pre-processes over 30 common abbreviations before counting sentence boundaries. The abbreviation list includes honorifics (Mr., Mrs., Ms., Dr., Prof., Sr., Jr.), titles (Gen., Gov., Sgt., Cpl., Pvt.), locations (St., Ave., Blvd.), organizations (Inc., Ltd., Corp.), academic (Fig., Vol., No., Est., Dept., Apt.), months (Jan. through Dec.), notation (vs., etc., approx.), and single-letter abbreviations (U.S., U.K., D.C.). For each abbreviation, the period is replaced with a middle dot (·) 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.
Which case should I use for JavaScript?
JavaScript follows well-established conventions: use camelCase for variables and function names (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).
Which case should I use for Python?
Python follows PEP 8 (the official Python style guide): use snake_case for variables, function names, and method names (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.
What code file formats can I upload?
The Text Case Converter accepts 16 file extensions: .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.
Is my code safe?
Completely safe. All 15 transformations are pure JavaScript string operations -- regex pattern matching with .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

Your Data Never Leaves Your Device

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

Milan Salvi

Milan Salvi

Founder, Leena Software Solutions

Milan is the founder of ZeroDataUpload and Leena Software Solutions, building privacy-first browser tools that process everything client-side. View all articles ยท About the author.

Last Updated: March 26, 2026