DevTools Logo

Vietnam Tax Code (MST) Generator

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

Runs in your browser

For Development & Testing Purposes Only - Synthetic Mock Data

Settings

1 value

Generates 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).

Legal Disclaimer: Generated data is for software testing and validation purposes only (e.g. verifying input masks, form validation, or database seeding). It is randomly generated and not taken from any real record, but a random value can coincidentally match a real, issued number, so never use it in real applications, payments, KYC or official forms. Using it to impersonate real people or for any fraudulent activity is illegal. DevTools accepts no liability for how generated data is used.

    Examples

    Generate a company MST

    Input
    VN MST · Generate
    Output
    0100233488

    Ten digits whose final check digit matches the weighted mod-11 result for the first nine.

    Generate a branch MST

    Input
    VN MST branch · Generate
    Output
    0314409058-002

    The same ten-digit code with a three-digit branch suffix appended after the hyphen.

    Reject a wrong check digit

    Input
    0100233480
    Output
    Invalid — the first 9 digits require check digit 8

    The 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

    1. Pick the MST type

      Choose the 10-digit company code, or the 13-digit branch code that appends a three-digit suffix.

    2. Generate a value

      Click Generate to create one code whose tenth digit satisfies the mod-11 rule and whose sequence is not all zeros.

    3. 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

    PartRule
    Digits 1–2Province code
    Digits 3–9Sequence; 0000000 is rejected
    Digit 10Check digit: 10 − (weighted sum mod 11); remainder 0 has no digit
    Digits 11–13Branch suffix after a hyphen; 000 is rejected
    Weights31, 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