Writing
Code
Other
Clean up
Shortcuts: Ctrl/Cmd + Enter copies the result, Ctrl/Cmd + Z undoes the last clean-up.
Naming conventions at a glance
Programmers join words without spaces in several standard ways. This page opens on CONSTANT_CASE. The buttons above switch the same text to dot.case, camelCase, PascalCase, snake_case, kebab-case or path/case.
| You type | CONSTANT_CASE result |
|---|---|
max retry count | MAX_RETRY_COUNT |
apiBaseUrl | API_BASE_URL |
user-first-name | USER_FIRST_NAME |
| You type | dot.case result |
|---|---|
max retry count | max.retry.count |
apiBaseUrl | api.base.url |
user-first-name | user.first.name |
The styles compared
| Style | Example | Usually used for |
|---|---|---|
| camelCase | maxRetryCount | Variables and functions in JavaScript, Java, Swift, Kotlin |
| PascalCase | MaxRetryCount | Classes and types; React components |
| snake_case | max_retry_count | Python, Ruby, Rust variables and functions; database columns |
| CONSTANT_CASE | MAX_RETRY_COUNT | Constants; environment variables |
| kebab-case | max-retry-count | URLs, CSS classes, file names |
| dot.case | max.retry.count | Configuration keys and property names |
CONSTANT_CASE
CONSTANT_CASE, also called SCREAMING_SNAKE_CASE, writes every letter in capitals with underscores between words. It marks values that do not change. Python's PEP 8 style guide asks for constants in this form, many Java and JavaScript projects use it, and environment variables are almost always written this way, such as DATABASE_URL.
dot.case
dot.case writes lowercase words separated by dots. You see it mostly in configuration, where dots show a hierarchy, such as server.port or logging.level.root. Because the dot also means "member of" in most languages, it is rarely used for variable names.
Using the converter
Paste a phrase or an existing name in any style. Underscores, hyphens, dots, spaces and the capitals inside names are all treated as word breaks, so you can convert between styles in either direction. Several lines convert together.
Single-style pages with more detail: camelCase, PascalCase, snake_case and kebab-case.
All converters: Uppercase to Lowercase · Lowercase to Uppercase · ALL CAPS Converter · ALL CAPS to Sentence Case · Capitalize Text · Title Case · Sentence Case · Toggle Case · Alternating Case · camelCase · PascalCase · snake_case · kebab-case
- What is CONSTANT_CASE?
- Words in capitals joined with underscores, such as MAX_RETRY_COUNT. It is used for constants and environment variables.
- What is dot.case?
- Lowercase words separated by dots, such as server.port. It is common in configuration files.
- Is CONSTANT_CASE the same as SCREAMING_SNAKE_CASE?
- Yes. Both names mean capital letters with underscores between words.
- Can I convert camelCase to CONSTANT_CASE?
- Yes. The converter splits the name where the capitals fall, so apiBaseUrl becomes API_BASE_URL.
- Does it handle several lines?
- Yes. Each line is converted on its own.