Text formatting styles – camelCase, snake_case and others
Different text writing styles are used in programming, SEO, file systems and URLs. Each has a different use and convention for capitalization and separators.
All letters uppercase. Used for headings, abbreviations and highlights.
All letters lowercase. Popular in URLs, tags and identifiers.
Every word capitalized. Article titles, headings.
Only the first word capitalized. Standard sentence writing.
First word lowercase, subsequent words capitalized. Standard in JavaScript and Java.
Every word capitalized, no separators. Class names and React components.
Words separated by underscores. Python, databases, Ruby.
snake_case in uppercase. Constants in code.
Words separated by hyphens. URLs, SEO slugs, CSS classes.
Words separated by dots. Java/Kotlin packages, configuration (e.g. application.properties).
Alternating uppercase and lowercase letters. Humorous style from internet memes.
| Format | Example | Languages / use | Description |
|---|---|---|---|
| UPPERCASE | HELLO WORLD | SQL, nagłówki | All letters uppercase. Headings, abbreviations, highlights. |
| lowercase | hello world | HTML tagi, URL | All letters lowercase. URLs, HTML tags, identifiers. |
| Title Case | Hello World | titles, headings | Every word capitalized. Article and chapter titles. |
| Sentence case | Hello world | texts, UI | Only the first word capitalized. Standard sentences. |
| camelCase | helloWorld | JS, Java, Swift | First word lowercase, subsequent words capitalized. Variables and functions in JS/Java. |
| PascalCase | HelloWorld | C#, React, TypeScript | Every word capitalized without separators. Classes, components. |
| snake_case | hello_world | Python, Ruby, SQL | Words separated by underscores. Python standard (PEP 8) and databases. |
| SCREAMING_SNAKE_CASE | HELLO_WORLD | Python, C, Java | snake_case in uppercase. Constants in code. |
| kebab-case | hello-world | CSS, URL, HTML atrybuty | Words separated by hyphens. Standard for URLs, SEO slugs and CSS classes. |
| dot.case | hello.world | Java pakiety, .env | Words separated by dots. Java/Kotlin packages, configuration files. |
| aLtErNaTiNg | hElLo WoRlD | memes, humor | Alternating uppercase and lowercase letters. Humorous style from the internet. |
When to use each style?
camelCase & PascalCase
JavaScript, TypeScript, Java, C# — variables, functions, classes, React components. PascalCase applies to classes and types, camelCase to variables and methods.
snake_case
Python (recommended by PEP 8), Ruby, Rust, SQL — column names, tables, variables. Readable with long multi-word names.
kebab-case
URLs and SEO slugs, CSS classes, HTML attributes (data-my-value), file names in frontend projects. Google prefers hyphens over underscores in URLs.
SCREAMING_SNAKE_CASE
Constants in Python, C, Java, environment variables (.env). Immediately signals that the value should not change.
Trivia
Name camelCase comes from the resemblance of the capital letters to the humps of a camel (Eng. camel). The variant with a lowercase first letter is lower camelCase, and PascalCase is sometimes called upper camelCase.
PascalCase got its name from the Pascal language created by Niklaus Wirth in 1970, in which it was commonly used for identifiers.
Google officially recommends kebab-case for URLs. Underscores in URLs were historically ignored by indexing bots, so hello_world could be treated as one word.
The style aLtErNaTiNg became popular as "mocking SpongeBob" after a viral meme from 2017 from the SpongeBob SquarePants series. It is used to mock someone's statement.
In the language Lisp it was traditionally used kebab-case for symbols as early as the 1950s — it was one of the first programming languages with its own naming convention.
The standard PEP 8 (2001) unified the code style in Python. The choice of snake_case for variables and SCREAMING_SNAKE_CASE for constants is the official recommendation of the language's creators.
Quick summary — which style where?
| Context | Recommended style |
|---|---|
| URLs / SEO slugs | kebab-case |
| CSS classes | kebab-case |
| JavaScript variables | camelCase |
| React components / C# classes | PascalCase |
| Python variables and functions | snake_case |
| Constants | SCREAMING_SNAKE_CASE |
| Java packages | dot.case |
| Article titles (EN) | Title Case |
| Regular sentences in UI | Sentence case |
Want to quickly change the text format? Use our tool Text Case Converter . Supports all the above styles and works directly in the browser.