AMPscript ProperCase (Next)
Convert a value to proper (title) case with AMPscript ProperCase in Marketing Cloud Next. Syntax, examples, and behaviour proven in a Marketing Cloud Next email, including spaces, the sharp s and booleans.
Syntax
ProperCase(sourceString) → string
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
sourceString |
string | number | date | boolean | Yes | Value to convert |
Example
%%=ProperCase("BARB BROWN")=%%
Renders Barb Brown.
The rest of each word is forced to lower case, so existing capitals inside a word are lost:
%%=ProperCase("HTML and CSS")=%%
Renders Html And Css.
Return value
string — the value with every word starting in upper case and all its other letters in lower case.
The result is arbitrary text, so there is no fixed set of special values to test for.
Behaviour
Capitals inside a word are lowered. ProperCase("iPhone") gives Iphone and ProperCase("McDONALD") gives Mcdonald. The function is safe on all-caps input and lossy on anything that already has meaningful capitals.
Only a space starts a new word. A letter after an apostrophe, hyphen, full stop or comma stays lower case: ProperCase("o'neill mcdonald-smith") gives O'neill Mcdonald-smith and ProperCase("a.b,c") gives A.b,c. Letters after a digit are not raised either: ProperCase("abc3def") gives Abc3def, ProperCase("3rd street") gives 3rd Street.
Spaces are kept as they are. ` spaced out ` (two spaces, spaced, three spaces, out, two spaces, built with Char(32)) gives ` Spaced Out , Length 16, as on Engagement. Write runs of spaces with Char(32): the Next render collapses a run typed into the email to one space before AMPscript runs, so ProperCase(“ spaced out “) typed as a literal comes out as Spaced Out `.
Accented letters are cased like any other. é at the start of a word becomes É; à and ü inside the word stay lower case (éàü éàü gives Éàü Éàü).
A leading sharp s expands. ProperCase(Concat(Char(223), "trasse")) gives SStrasse, so the result (Length 8) is one character longer than the input.
An empty string gives an empty string, and a one-letter word is capitalised: ProperCase("x") gives X.
Numbers are unchanged. ProperCase(12345) gives 12345.
Dates are turned into text, then cased. ProperCase(Now()) gave a value like 2026-11-23t00:20:52: the T between date and time sits inside a word, so it is lowered.
Booleans become their word. ProperCase(true) gives True.
No argument or two arguments cannot be saved. ProperCase() and ProperCase("a b", "c d") are rejected at save with HTTP 400 “The AMPscript syntax isn’t valid”.
Show Next test script
<!-- Marketing Cloud Next test script for ProperCase. Paste it into the HTML component of a
Next email and open the preview. Each line prints the result Next gave when the call
was rendered on its own (expect) next to the result of this run (got).
Assembled from single-call test emails (dates on the page); it has not been
run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[Hello World] got=[%%=ProperCase("hello world")=%%]</p>
<p>c2 expect=[Mcdonald] got=[%%=ProperCase("McDONALD")=%%]</p>
<p>c3 expect=[Html And Css] got=[%%=ProperCase("HTML and CSS")=%%]</p>
<p>c4 expect=[Barb Brown] got=[%%=ProperCase("BARB BROWN")=%%]</p>
<p>c5 expect=[Iphone] got=[%%=ProperCase("iPhone")=%%]</p>
<p>c6 expect=[O'neill Mcdonald-smith] got=[%%=ProperCase("o'neill mcdonald-smith")=%%]</p>
<p>c7 expect=[A.b,c] got=[%%=ProperCase("a.b,c")=%%]</p>
<p>c8 expect=[Abc3def] got=[%%=ProperCase("abc3def")=%%]</p>
<p>c9 expect=[3rd Street] got=[%%=ProperCase("3rd street")=%%]</p>
<p>c10 expect=[A1b C2d] got=[%%=ProperCase("a1b c2d")=%%]</p>
<p>c11 expect=[X] got=[%%=ProperCase("x")=%%]</p>
<p>c12 expect=[] got=[%%=ProperCase("")=%%]</p>
<p>c13 expect=[Éàü Éàü] got=[%%=ProperCase(Concat(Char(233), Char(224), Char(252), " ", Char(233), Char(224), Char(252)))=%%]</p>
<p>c14 expect=[SStrasse] got=[%%=ProperCase(Concat(Char(223), "trasse"))=%%]</p>
<p>c15 expect=[8] got=[%%=Length(ProperCase(Concat(Char(223), "trasse")))=%%]</p>
<p>c16 expect=[12345] got=[%%=ProperCase(12345)=%%]</p>
<p>c17 expect=[Abc 42def] got=[%%=ProperCase("abc 42def")=%%]</p>
<p>c18 expect=[2026-11-23t00:20:52] got=[%%=ProperCase(Now())=%%]</p>
<p>c19 expect=[True] got=[%%=ProperCase(true)=%%]</p>
<p>c20 expect=[ Spaced Out ] got=[%%=ProperCase(Concat(Char(32), Char(32), "spaced", Char(32), Char(32), Char(32), "out", Char(32), Char(32)))=%%]</p>
<p>c21 expect=[16] got=[%%=Length(ProperCase(Concat(Char(32), Char(32), "spaced", Char(32), Char(32), Char(32), "out", Char(32), Char(32))))=%%]</p>
Show calls that fail in Next (one email each)
<!-- Run each call below in its own Next email: one of them in a combined email
would stop the whole preview or block the save. -->
<!-- email 1: expect that the save is rejected (HTTP 400) -->
%%=ProperCase()=%%
<!-- email 2: expect that the save is rejected (HTTP 400) -->
%%=ProperCase("a b", "c d")=%%
Differs from official docs
- Only a space starts a word. The reference does not define a word; in Next
ProperCase("o'neill mcdonald-smith")givesO'neill Mcdonald-smith. Card - A leading ß becomes
SS. Not mentioned in the reference; the result is one character longer than the input. Card
Availability & differences
| Platform | Available |
|---|---|
| Marketing Cloud Engagement | Yes |
| Marketing Cloud Next | Yes, from API 67.0 |
Engagement leaves a leading sharp s alone (ßtrasse) and returns an empty string for a boolean. In Next a leading ß becomes SS (SStrasse), and ProperCase(true) gives True. Spaces are kept on both: ` spaced out ` gives ` Spaced Out ` (length 16). In a Next email, write runs of spaces with Char(32), because the render collapses runs typed into the email before AMPscript runs. Compared 2026-11-23 by rendering the same calls in a Marketing Cloud Next email.
See also
UppercaseLowercase— the whole-string conversionsTrim— remove padding before casing a field- Official reference