Vietnam Tax Code (MST) Generator
Generate 10-digit Vietnamese tax codes (mã số thuế) and 13-digit branch codes with the mod-11 check digit — synthetic test data only
For Development & Testing Purposes Only - Synthetic Mock Data
Settings
1 valueGenerates one value with a valid checksum. Press ⌘/Ctrl+Enter for a fresh one.
Generated value
No value yet
Set options, then press Generate.
Generated values are valid in shape but randomized (Test Data).
Examples
Generate a company MST
VN MST · Generate0100233488Ten digits whose final check digit matches the weighted mod-11 result for the first nine.
Generate a branch MST
VN MST branch · Generate0314409058-002The same ten-digit code with a three-digit branch suffix appended after the hyphen.
Reject a wrong check digit
0100233480Invalid — the first 9 digits require check digit 8The validator recomputes the check digit and reports the value it expected.
About this tool
The Vietnam Tax Code (MST) Generator produces one mã số thuế value, the tax code the General Department of Taxation assigns to companies and other organizations. A company code uses ten digits: a two-digit province, a seven-digit sequence, and a mod-11 check digit computed with the weights 31, 29, 23, 19, 17, 13, 7, 5 and 3.
A dependent unit appends a three-digit branch suffix after a hyphen for thirteen digits, so 0314409058-002 identifies a branch of the taxpayer registered under 0314409058. If the first nine digits leave a remainder of zero, no check digit can satisfy them, which is why the validator rejects that case instead of guessing.
These are synthetic values for QA and development: never use them on real applications, KYC checks, tax filings, or identity documents, and DevTools accepts no liability for how generated data is used. A random value can coincidentally match a real tax code. Since July 2025 individuals may use their 12-digit personal identification number as a tax code; this tool covers the 10- and 13-digit organization layouts only.
What this tool does not do
- The check digit is verified, but the tool cannot confirm that a tax code is active or registered.
- Individual tax codes that reuse the 12-digit personal identification number are not covered.
- Province prefixes are drawn from a short list, so some real provincial ranges may not appear.
- A generated code can coincide with a real registration; treat every value as test data only.
How to use this tool
Pick the MST type
Choose the 10-digit company code, or the 13-digit branch code that appends a three-digit suffix.
Generate a value
Click Generate to create one code whose tenth digit satisfies the mod-11 rule and whose sequence is not all zeros.
Copy or validate
Copy the code to an invoice fixture or download it as a .txt file, or switch to Validate to check a pasted MST.
Use cases
Invoice and VAT fixtures
Seed Vietnamese invoice mockups with a company or branch code that passes the mod-11 check.
Branch handling
Test whether your form accepts the 13-digit branch form and splits the suffix correctly.
Negative-path tests
Use the broken samples to confirm your validation surfaces the expected check digit.
Vietnamese MST layout
| Part | Rule |
|---|---|
| Digits 1–2 | Province code |
| Digits 3–9 | Sequence; 0000000 is rejected |
| Digit 10 | Check digit: 10 − (weighted sum mod 11); remainder 0 has no digit |
| Digits 11–13 | Branch suffix after a hyphen; 000 is rejected |
| Weights | 31, 29, 23, 19, 17, 13, 7, 5, 3 |
Validation reports the check digit the first nine digits require, so a broken sample names the expected value.
Common mistakes
Mistake:Treating the check digit as a serial digit
Fix:The tenth digit is computed from the first nine; changing the sequence changes it.
Mistake:Assuming a 13-digit value is a different taxpayer
Fix:The first ten digits identify the taxpayer; the suffix identifies a dependent unit.
Mistake:Ignoring the remainder-zero case
Fix:When the first nine digits leave remainder 0, no valid check digit exists and the validator rejects the value.
Frequently asked questions
Are these real Vietnamese tax codes?
No. They are synthetic fixtures for QA and development, never for real applications, KYC checks, tax filings, or identity documents, and DevTools accepts no liability for how they are used.
How is the MST check digit calculated?
The first nine digits are weighted by 31, 29, 23, 19, 17, 13, 7, 5 and 3; the check digit is 10 minus the remainder modulo 11, and a remainder of 0 has no valid digit.
What is the difference between a 10-digit and a 13-digit MST?
The ten digits identify the taxpayer; a 13-digit value appends a three-digit branch suffix after a hyphen for a dependent unit.
Can individuals use a different tax code format?
Yes. Since July 2025 individuals may use their 12-digit personal identification number as a tax code; this tool covers the organization layouts only.
Why does the validator report a required check digit?
It recomputes the digit from the first nine digits, so a broken sample shows both the value found and the value required.
References & standards
Related tools
Vietnam CCCD Number Generator
Generate synthetic 12-digit Vietnamese citizen identity (CCCD) numbers with a real province code and birth-year digits, and validate pasted values.
VAT Number Generator
Generate VAT numbers for EU, UK, Switzerland, Norway and global tax integration testing.
Tax Number Generator
Generate valid tax identification numbers for testing (TR, US, SG, etc.)
National Identity Generator
Generate and validate national ID numbers for testing (TR, US, DE, UK, SA, AE, QA, KW, CA, ES, BR, FR, IT, NL, SE, NO, EG, SG)
Tax ID Validator
Auto-detect and validate VAT, EIN, TIN and GST identifiers with batch checksum reporting.