Snake Case Converter – Convert Text to snake_case Online | WordTweek
Free online text tool

Snake Case

Snake case converts text to lowercase and replaces spaces with underscores, so helloWord this is an example of how snake caseLooks becomes hello_word_this_is_an_example_of_how_snake_case_looks. It also splits camelCase words and is commonly used for variables, functions and database columns. Paste your text, then copy the result. It is free and runs in your browser.

Snake case example

Before

helloWord this is an example of how snake caseLooks

After

hello_word_this_is_an_example_of_how_snake_case_looks

Before

HTMLParser for API v2

After

html_parser_for_api_v2

Before

Room Number 7, Floor-3

After

room_number_7_floor_3

How to convert text to snake case

  1. Enter your text. Type, paste or import a .txt file. Each line is converted on its own.
  2. Check the result. The snake case version updates as you type.
  3. Copy it. Press Copy result and paste it into your code, spreadsheet or document.

Where snake case is used

Variables and functions

The standard naming style in Python, Ruby and Rust, such as user_profile_page.

Databases

Common for table and column names in SQL databases, such as created_at and order_items.

Files and constants

Used for file names, and in UPPER_SNAKE_CASE for constants and environment variables.

Snake case vs other naming styles

StyleExampleTypical use
Snake caseuser_profile_pagePython, Ruby, Rust variables, database columns
Upper snake caseUSER_PROFILE_PAGEConstants and environment variables
Camel caseuserProfilePageVariables and functions in JavaScript, Java
Pascal caseUserProfilePageClass names in C#, Java, TypeScript
Kebab caseuser-profile-pageURLs, CSS classes, file names

Snake case separates words with underscores, while camel case and Pascal case join words together and use capital letters instead.

Frequently asked questions

What is snake case?

Snake case writes words in lowercase and joins them with underscores instead of spaces, for example hello_world. It is also called snake_case and is popular in programming and databases.

How do I convert text to snake case?

Type or paste your text into the input box. The snake case version appears instantly in the result box. Press Copy result and paste it into your code, spreadsheet or document.

Does it convert camelCase and PascalCase to snake case?

Yes. The tool splits words where a lowercase letter meets a capital letter, so helloWord becomes hello_word and HTMLParser becomes html_parser.

What happens to punctuation and extra spaces?

Spaces, hyphens, punctuation and repeated separators are treated as word breaks and replaced with a single underscore. No underscores are added at the start or end.

How do I get UPPER_SNAKE_CASE?

Tick the UPPER_SNAKE_CASE option. Every letter is made uppercase, so max retry count becomes MAX_RETRY_COUNT. This style is commonly used for constants.

Where is snake case used?

Snake case is the standard naming style for variables and functions in Python, Ruby and Rust, and is widely used for database table and column names and file names.

Does it convert each line separately?

Yes. Every line becomes its own snake case name, so you can convert a whole list of names at once.

Is the tool free and private?

Yes. It is free, needs no account, and runs in your browser, so the text you enter is not uploaded to a server.

Share this tool

Bookmark this page: press Ctrl+D (Windows) or Cmd+D (Mac).

Last updated: November 2026 · Free · No sign-up · Runs in your browser

Copied!