snake_case Converter Online
Convert any text to snake_case naming convention instantly in your browser. This free tool processes everything client-side, keeping your data private.
Text Case Converter
Convert text between camelCase, snake_case, kebab-case, and more. Results update as you type.
About Case Conversion
- Automatically detects word boundaries from camelCase, separators (hyphens, underscores, dots, slashes), and whitespace.
- Supports 11 case styles commonly used in programming, CSS, file paths, and documentation.
- Everything runs in your browser — no data is sent over the network.
What is snake_case?
snake_case is a naming convention where multi-word identifiers are written in all lowercase with words separated by underscores. For example, "user first name" becomes "user_first_name". It is one of the most readable naming conventions because the underscores act as clear visual separators between words.
Where is snake_case used?
snake_case is the standard naming convention in Python (PEP 8), Ruby, Rust, and PostgreSQL. It is also common for database column names, environment variables (often in SCREAMING_SNAKE_CASE), and REST API field names in Python-based frameworks like Django and FastAPI. C and C++ also traditionally use snake_case.
// JavaScript — convert camelCase to snake_case
function toSnakeCase(str) {
return str
.replace(/([A-Z])/g, '_$1')
.toLowerCase()
.replace(/^_/, '');
}
toSnakeCase('userFirstName'); // 'user_first_name'
# Python — convert camelCase to snake_case
import re
def to_snake_case(s):
return re.sub(r'(?<!^)(?=[A-Z])', '_', s).lower()
to_snake_case('userFirstName') # 'user_first_name'Frequently Asked Questions
How do I convert camelCase to snake_case?
Paste your camelCase text into the converter and it will automatically insert underscores before each uppercase letter and lowercase the entire string. For example, "userFirstName" becomes "user_first_name".
What is SCREAMING_SNAKE_CASE?
SCREAMING_SNAKE_CASE (also called CONSTANT_CASE) uses all uppercase letters with underscores, like MAX_RETRY_COUNT. It is the standard convention for constants in Python, Java, JavaScript, and most other languages.
Related Convert Tools
OpenAPI to TypeScript
Convert OpenAPI 3.x and Swagger 2.0 specs to TypeScript interfaces and types with $ref resolution, allOf/oneOf/anyOf, enums, and API operation types
JSON to Zod Converter
Convert JSON or JSON Schema to Zod validation schemas with $ref resolution, allOf/oneOf/anyOf, enum, format constraints, and required/optional fields
GraphQL to TypeScript
Convert GraphQL SDL schemas to TypeScript interfaces, types, enums, unions, and operations
TypeScript to JavaScript
Convert TypeScript to JavaScript — strip types, interfaces, enums, generics, and access modifiers to get clean JS output