VoiceGem

Casing converter: camel, pascal, snake, kebab, constant

A casing converter rewrites a name into a different word-separation convention: camelCase, PascalCase, snake_case, kebab-case or CONSTANT_CASE. Paste one name or a thousand, get all five at once. The casing function here is the one VoiceGem runs when it hears a spoken casing command.

Given a name in any casing, produce it in all five styles, in under 1 second.

4 names. There is no line limit — the conversion runs in this tab and costs nothing to run.

Each input name in all five casing styles
InputcamelCasePascalCasesnake_casekebab-caseCONSTANT_CASE
maxRetryCountmaxRetryCountMaxRetryCountmax_retry_countmax-retry-countMAX_RETRY_COUNT
api_base_urlapiBaseUrlApiBaseUrlapi_base_urlapi-base-urlAPI_BASE_URL
user-profileuserProfileUserProfileuser_profileuser-profileUSER_PROFILE
HTTPResponseCodehttpResponseCodeHttpResponseCodehttp_response_codehttp-response-codeHTTP_RESPONSE_CODE

The same five styles work from speech.

Saying “constant case api base url” produces API_BASE_URL in your editor, with no conversion step and no clipboard. The converter that does it is on the next page, and it runs on a line you type rather than a name you already have.

Try the speech-to-code converter

VoiceGem has no mailing list and runs no drip sequence. An address left here is stored on voicegem.app for one purpose — sending you a single message when the code-dictation accuracy benchmark publishes — and is deleted after that send. The lawful basis is your consent, given by submitting this form; the field is optional and nothing is pre-selected. Leaving it blank costs you nothing on this page, because everything above is already yours. See the privacy policy.

This tool runs entirely in your browser. Names you paste are converted by a JavaScript function on this page and nothing is sent anywhere, stored, or logged — which matters more than usual here, because identifier names leak schema and API design. The one exception is the email box under the result.

What the five casing styles are for

Casing conventions carry meaning that a language does not enforce. camelCase and PascalCase differ only in the first letter, and most ecosystems use that one letter to separate a value from a type: userService is an instance, UserService is the class. snake_case is the default for identifiers in Python, Ruby and SQL, and for JSON keys in APIs written by people from those ecosystems. kebab-case cannot be an identifier in most languages at all, which is exactly why it owns URLs, CSS class names and file names. CONSTANT_CASE marks a value that does not change, and by convention an environment variable.

The conversion itself is mechanical once you know where the words are, and that is the part worth being precise about. The converter above uses VoiceGem's own casing function and treats three things as a word boundary: any separator character, a lowercase-to-uppercase transition, and the end of an acronym run. That last rule is why HTTPResponseCode splits into HTTP, Response and Code rather than into one word or into eleven letters.

How to convert casing by hand, and when that stops working

Converting one name by hand is faster than opening a tool. Converting a column of forty database fields is not, and converting them in an editor with a regular expression is where most people lose ten minutes: the expression that handles user_id correctly mangles api_url_v2, and the one that handles acronyms correctly splits IOError into I and O and Error.

Editor plugins solve this well for a single selection and badly for a list, because they convert in place and give you one style at a time. The converter above returns all five styles for every line at once, which is the shape the job usually has — you are choosing a convention, not applying a known one.

VoiceGem handles the same job from the other direction. Rather than converting a name that already exists, it builds the name from words you say: "constant case api base url" produces API_BASE_URL directly, with no intermediate form to convert.

Where casing conversion breaks down

Three inputs defeat every casing converter, this one included, and knowing which three saves you checking the output every time. Names containing digits are ambiguous: v2Api could be v2 / Api or v / 2 / Api, and no rule is right for both createV2Endpoint and parse2DPoint. Names containing initialisms next to each other, like XMLHTTPRequest, have no boundary a machine can find. And names that were already in the target style pass through unchanged, which looks like a failure and is not.

Round-tripping is the failure that costs real time. Converting userID to snake_case gives user_id, and converting that back to camelCase gives userId — the capital D is gone and no converter can know it was there. If a name has to survive a round trip, keep the original rather than the converted form as the source of truth.

VoiceGem avoids the whole class of problem for names it creates, because a spoken casing command receives ordinary words and never has to guess at boundaries. It cannot help with names that already exist in a codebase, which is what a converter is for.

What this tool has to do with dictation

Casing is the part of code dictation that a punctuation table alone cannot solve. Saying "user profile" and wanting userProfile needs something that knows where the identifier starts and ends. VoiceGem solves it with a casing command that claims the run of ordinary words after it and stops at the first symbol or command, so "camel case total count plus one" gives totalCount + one rather than swallowing the line.

The five styles on this page are the five VoiceGem can produce from speech, and the function that produces them is the same one running above. Whether that is interesting depends on why you came here: if you are converting a CSV header, it is not, and the tool works either way with no account and no cap.

Related: how the speech-to-code converter works, the same thing for the spoken-symbol reference, or how the filler word remover works.

Common questions

No. The conversion is a JavaScript function in your browser tab, so it costs nothing to run and there is nothing to meter. Paste as many lines as you like.

Three rules: any non-alphanumeric character separates words, a lowercase letter followed by an uppercase letter starts a new word, and a run of capitals ends one word before the last capital. HTTPResponseCode becomes HTTP, Response, Code.

No. Everything happens in the page. Identifier names describe your schema and your API surface, so this is worth checking on any converter you use — not only this one.

Nothing — they are two names for the same style. VoiceGem accepts "constant case", "screaming snake case" and "scream case" as spoken commands, and all three produce the same output.

Yes. A spoken casing command followed by ordinary words produces the identifier directly in your editor. The speech-to-code converter on this site runs the same function on text you type.