Case Converter→Specialized Version
🔤

Go Exported Name Converter

Convert text to PascalCase

Acronyms split the way programmers expect: XMLHttpRequest becomes xml_http_request, not x_m_l_http_request.

Go Exported Name Converter

PascalCase writes HelloWorldExample. In Go, capitalisation is not style — it is access control. An identifier starting with an uppercase letter is exported from its package; a lowercase one is not. So PascalCase makes a type, function or field public, and camelCase keeps it internal. Go also demands consistent initialisms: URL, ID and HTTP stay fully capitalised, giving ServeHTTP and UserID rather than ServeHttp and UserId.

Conversions

InputPascalCase
hello world exampleHelloWorldExample
XMLHttpRequestXmlHttpRequest
user_first_nameUserFirstName
Total Order CountTotalOrderCount
Acronyms are where conventions diverge. XMLHttpRequest stays intact in PascalCase, but Go's own style guide requires initialisms to be fully capitalised — ServeHTTP, not ServeHttp — while C# convention capitalises only the first letter of an acronym longer than two characters.

The Same Text in Other Cases

CaseResult
camelCasehelloWorldExample
snake_casehello_world_example
SCREAMING_SNAKE_CASEHELLO_WORLD_EXAMPLE
kebab-casehello-world-example
Train-CaseHello-World-Example
dot.casehello.world.example

Capitalisation Is Access Control

Go has no public or private keyword. An identifier starting with an uppercase letter is exported from its package and one starting lowercase is not — for types, functions, methods, fields and package-level variables alike.

The second rule is initialisms: golint requires them fully capitalised, giving ServeHTTP, UserID and parseURL rather than ServeHttp, UserId and parseUrl. The list is conventional rather than syntactic, and a struct field named Id is among the most common review comments in Go.

Converting in Code

``javascript const pascal = (s) => words(s) .map((w) => w[0].toUpperCase() + w.slice(1).toLowerCase()) .join(''); `

Lower-casing the remainder of each word destroys deliberate internal capitals. parseJSON becomes ParseJson, which is correct C# and wrong Go — the convention has to be a parameter, not a hard-coded rule.

Converting at the API Boundary

The recurring friction is that JavaScript uses camelCase and Python, Ruby, Go and SQL use snake_case. The fix is to convert in exactly one place — the client that talks to the API — rather than letting both conventions into the same codebase.

`javascript const toCamel = (s) => s.replace(/_([a-z])/g, (_, c) => c.toUpperCase()); const toSnake = (s) => s.replace(/[A-Z]/g, (c) => '_' + c.toLowerCase());

// Recursively, for a whole payload const convertKeys = (value, fn) => Array.isArray(value) ? value.map((v) => convertKeys(v, fn)) : value && typeof value === 'object' ? Object.fromEntries(Object.entries(value).map(([k, v]) => [fn(k), convertKeys(v, fn)])) : value; `

Two things to watch: keys that are user data rather than field names must not be converted, and the round trip is not always lossless — userID → user_id → userId changes the original.

Where Each Convention Is Mandatory

Not stylistic — these will break if you deviate:

ContextRequirement
Environment variablesUppercase with underscores; POSIX reserves lowercase
Custom HTML elementsMust contain a hyphen
Python modulesCannot contain hyphens; the import statement will not parse
SQL identifiersFolded to one case unless quoted, so camelCase does not survive
React componentsMust start uppercase, or JSX treats it as an HTML tag

Renaming Safely

A find-and-replace across a codebase will hit strings, comments and unrelated identifiers. Use your language server's rename symbol instead — it understands scope. For a bulk rename across files, restrict the pattern with word boundaries and review the diff before committing:

`bash grep -rn '\buserId\b' src/ # look first ``

Frequently Asked Questions

When should I use PascalCase?

In Go, capitalisation is not style — it is access control. An identifier starting with an uppercase letter is exported from its package; a lowercase one is not. So `PascalCase` makes a type, function or field public, and `camelCase` keeps it internal. Go also demands consistent initialisms: `URL`, `ID` and `HTTP` stay fully capitalised, giving `ServeHTTP` and `UserID` rather than `ServeHttp` and `UserId`.

How are acronyms handled?

Correctly. `XMLHttpRequest` becomes `XmlHttpRequest`, treating the run of capitals as one word rather than splitting every letter.

Does the converter handle numbers and punctuation?

Numbers stay attached to the word they belong to; punctuation and separators are treated as word boundaries and removed. `order-2-total` and `order_2_total` both produce the same words.

Related Tools

Explore other tools you might find useful:

More Case Converter tools

You might also need