1. Clean the input
Remove spaces, parentheses and hyphens while preserving the digits and country context.
+62 test data
Generate Indonesia phone number examples for development, QA, input masks and documentation. Results are not live subscriber lines.
| Calling code | +62 |
|---|---|
| National pattern | 08xx-xxxx-xxxx |
| E.164 example | +6281234567890 |
| Typical length | Variable mobile length after +62 |
Remove spaces, parentheses and hyphens while preserving the digits and country context.
Remove the leading domestic 0 before adding +62; validate the remaining length against the selected mobile range.
Use +6281234567890 for machine storage and format it for display at the edge of your application.
| Case | Fixture | Expected test behavior |
|---|---|---|
| National display | 08xx-xxxx-xxxx | Accept punctuation, then normalize. |
| Valid E.164 structure | +6281234567890 | Accept for format testing; do not infer reachability. |
| Invalid length | +6281234567 | Reject before storing or sending to an API. |
Manually reviewed country notes
Indonesian mobile numbers use domestic 08 prefixes and variable lengths by range. This 0812 fixture removes the trunk zero before +62, but production validation must not impose this example's length on every Indonesian mobile allocation.
Komdigi's regulation is a numbering source, not a fictional subscriber list. The generated value is potentially assigned and is suitable only for isolated formatting tests.
Convert domestic 0812 to international +62 812.
Validate length against the selected mobile range.
Keep operator and reachability checks outside basic normalization.
These cases document the fixture contract used by GetPhoneNum. They test parsing and normalization only; they never prove that a subscriber exists.
| Input | Expected result | Reason |
|---|---|---|
0812-3456-7890 | +6281234567890 | Convert this 0812 fixture |
+62 812 3456 7890 | +6281234567890 | Normalize punctuation |
0062 812 3456 7890 | +6281234567890 | Convert an access prefix |
+62 0812 3456 7890 | Reject or repair | The trunk zero follows +62 |
0812-3456 | Review range | Variable plans need range metadata |
Reviewed by GetPhoneNum Editorial Team · Last reviewed August 11, 2026
Test empty input, pasted punctuation, a missing country code, one digit too few and one digit too many. Avoid using a single global regex for every country.
Test a JavaScript regexStore a normalized E.164 value and keep display formatting separate. Try the E.164 formatter or structural validator.
Numbering plans change. Use a maintained numbering library and treat carrier, line type and reachability as separate checks.
Browse calling-code referencesRelated generators and tools
They are generated test fixtures, not verified subscriber lines. Even a structurally valid value may coincide with an assigned number unless it comes from an officially reserved fictional range.
+62 is the international country calling code for Indonesia. In E.164 format it appears after the leading plus sign and before the national number.
No capability is provided or verified. Do not call, text or use generated values for account verification.
Numbering rules can change. Check the Komdigi telecommunications regulation before enforcing production rules.
Create up to 100 local fixtures in the browser, download the open dataset, or use the API design reference to define a deterministic contract for automated test suites.