Guide

camelCase to snake_case Converter (and PascalCase, kebab-case)

Written by Alex Johnson  ·  6 min read  ·  Updated November 2026  ·  Virtual Text Tools

Case Converter

Transform text case instantly
Input
Output

Runs entirely in your browser. Nothing is uploaded. No limits, no signup.

Each programming language has its own habit for joining words into a name. Python writes user_name, JavaScript writes userName, CSS writes user-name. Moving data or code between them means renaming things, and doing it by hand across a long list of fields is slow and easy to get wrong.

Quick answer: paste one name per line into the converter above and press the format you need. getAPIResponse becomes get_api_response, is_logged_in becomes isLoggedIn, and each line is converted separately so a list stays a list.

How the converter finds the words

To change a name from one style to another, the converter first has to work out where each word starts. It splits a line wherever it finds:

It then joins the words back together in the style you picked. Here is the same list run through each button:

Inputsnake_casecamelCasekebab-case
userNameuser_nameuserNameuser-name
getAPIResponseget_api_responsegetApiResponseget-api-response
HTTPServerhttp_serverhttpServerhttp-server
is_logged_inis_logged_inisLoggedInis-logged-in
Primary Button Largeprimary_button_largeprimaryButtonLargeprimary-button-large

Two consequences are worth knowing. Acronyms lose their capitals when converted to camelCase or PascalCase, so getAPIResponse comes back as getApiResponse. Many style guides, including Google's for Java and JavaScript, prefer that form, but if your codebase writes getAPIResponse you will need to fix those by hand. And a digit followed by a capital starts a new word, so version2Update becomes version2_update.

For SCREAMING_SNAKE_CASE constants, convert to snake_case, press Swap, then press UPPERCASE.

Which convention each language uses

snake_case

All lowercase, words joined with underscores: user_name, created_at. It is the standard for Python functions, variables and modules (the naming section of PEP 8 spells this out), for Ruby methods and variables, and for most SQL table and column names.

camelCase

First word lowercase, each later word capitalized: userName, handleSubmit. Used for variables and functions in JavaScript and TypeScript, and for variables and methods in Java, Kotlin and Swift. Most JSON APIs built for JavaScript clients use it for keys.

PascalCase

Every word capitalized: UserProfile, DatabaseConnection. Used for class names in almost every object-oriented language, for React components, for TypeScript types and interfaces, and for methods and properties in C#.

kebab-case

All lowercase with hyphens: primary-button, background-color. Used for CSS class names and properties, HTML attributes, npm package names and URL slugs. Google's URL structure guidance recommends hyphens rather than underscores to separate words in addresses. Most programming languages cannot use it for variable names, because they read the hyphen as a minus sign.

SCREAMING_SNAKE_CASE

All capitals with underscores: MAX_RETRIES, API_BASE_URL. Used for constants in Python, Java and many JavaScript style guides, and for environment variables almost everywhere.

Where conversions come up

The most common case is an API boundary. A Python or Ruby backend returns first_name and created_at, and the JavaScript frontend wants firstName and createdAt. Many frameworks can map these automatically. Django REST Framework, Rails and most ORMs have settings or plugins for it, and that is usually the better fix for a whole codebase. A converter is quicker for one-off jobs: writing a TypeScript interface for an API you do not control, renaming the columns of a CSV export, or turning a list of design-tool layer names like "Primary Button Large" into CSS classes.

Whatever direction you are going, convert the names and then search the codebase for the old ones. Renaming a key in one place and not another is the usual source of the undefined values that follow.

Frequently asked questions

How do I convert camelCase to snake_case?

Paste the names into the converter, one per line, and press snake_case. Capital letters inside a name are treated as word breaks, so userFirstName becomes user_first_name.

What is the difference between camelCase and PascalCase?

camelCase starts with a lowercase letter (myVariable) and PascalCase starts with a capital (MyVariable). In most languages camelCase is used for variables and functions, PascalCase for classes and types.

Can I convert a whole list at once?

Yes. Each line is converted separately, so a column of field names pasted from a spreadsheet comes back as a column.

How do I get SCREAMING_SNAKE_CASE?

Convert to snake_case, press Swap to move the result into the input, then press UPPERCASE.

Why did my acronym lose its capitals?

When converting to camelCase or PascalCase, every word after the first is written as one capital followed by lowercase letters, so API becomes Api. That matches many style guides, but you can restore the capitals by hand if your project spells them out.

Convert a list of names

snake_case, camelCase, PascalCase, kebab-case and more. Nothing is uploaded.

↑ Back to the converter
AJ
Alex Johnson
Developer & Founder, Virtual Text Tools
Alex Johnson is a developer and the founder of Virtual Text Tools. After years of being forced to create accounts just to count words or clean up a list, he built a suite of free, browser-based text utilities that work instantly with no signup required.