I recently launched a small tool: SeveranceGO-CN: China Severance Pay Calculator . The source code is also on GitHub: masonblog/SeveranceGO-CN .

Its purpose is straightforward. After you enter information such as the start and end dates of employment, last year’s income, the place where the employment contract was performed, whether a written contract was signed, and the reason for departure, the tool estimates statutory severance, damages for unlawful termination, payment in lieu of notice, and the possible double-wage range for failure to sign a written employment contract.

Let me put the disclaimer up front: this is only an auxiliary estimate. It cannot replace formal legal advice or a lawyer’s judgment. In a labor dispute, the reason for termination, notice procedure, evidence, local wage standards, and the approach of the arbitration commission or court may all affect the final result. The tool is more like a first-round checkup: it gives the user a rough range, highlights key variables, and points out what should be verified next.

Why I Built It

In corporate work and labor dispute consultations, I often hear the same question:

The company wants to terminate my employment contract. Roughly how much can I get?

The question sounds simple, but it is easy to calculate incorrectly.

Many people remember only one formula: one month of pay for each year of service is N, and unlawful termination is 2N. Once the formula is applied to a real case, details appear immediately. How should years of service be rounded? Does a period of more than six months but less than one year count as one year? Is the monthly wage subject to a statutory cap? What is the local average monthly wage for employees in the previous year? Is the employer relying on no-fault termination, or on an economic layoff? Was thirty days’ prior notice given? If no written contract was signed, when does the double-wage period begin and end?

A lawyer can of course explain these points one by one, but many basic questions can first be handled by a form. Before a consultation, if the party already knows whether the issue may involve N, N+1, 2N, or a double-wage claim, the conversation becomes much more efficient.

So I wanted to build a plain tool: one that does not create anxiety, does not promise an outcome, but lays out the rules and makes the calculation process visible.

This project was largely built with vibe coding, but it also reminded me of something important: for a legal tool to be useful, the difficulty is not only in writing code. It is in translating the legal rules into structure.

For example, statutory severance under China’s Employment Contract Law seems to have a clear formula. But when implemented in software, it has to be broken down into many questions: the start and end dates of employment, whether the employee’s monthly wage exceeds the local cap, whether the situation falls under Article 46, whether payment in lieu of notice may apply, whether double wages for the absence of a written contract should be calculated separately, and so on.

If these branches are not thought through, the result will either be overly confident or overly vague.

One common problem is going too far. The tool may only be making an estimate under public rules, but it presents the result as if the user will definitely receive that amount. That is dangerous. Labor disputes depend heavily on evidence and procedure. The wording of a termination notice, a recorded conversation, or the background to a job transfer or pay cut may change the legal assessment.

The opposite problem is being too cautious. If everything is reduced to “it depends,” the user still has no idea where they stand.

I wanted the tool to sit somewhere in the middle. It should calculate what can be calculated, give clear warnings where warnings are needed, and leave space where the law requires judgment. For a suspected unlawful termination, for example, it shows a possible 2N range while reminding the user to check the termination reason, company rules, delivery procedure, and evidence chain. For an Article 40 termination, it treats thirty days’ prior notice as a factor affecting N+1. For the absence of a written contract, it estimates the possible double-wage range separately instead of crudely folding it into severance.

This is also one advantage lawyers have when participating in vibe coding: we are sensitive to uncertainty. Code tends to prefer definite answers. Law often produces risk ranges. A usable legal product has to admit that uncertainty.

Data Standards: Useful First, Then Keep Improving

The first version includes reference wage data for 2024 and covers prefecture-level cities, autonomous prefectures, regions, leagues, and some county-level units directly administered by provinces across mainland China’s provincial-level administrative regions. The difficult part is that public data is not published in a fully consistent way. Some cities provide official full-caliber or urban unit average wage figures; for others, the tool can only temporarily use regional data from the National Bureau of Statistics as a cap reference. Minimum wage standards may also have multiple tiers.

That is why I kept override fields on the page. If a user knows the latest local standard used by the arbitration commission, court, or human resources authority, they can enter it manually. For a legal tool, that is more honest than pretending the database will always be correct.

I will continue to supplement and correct the data sources. Friends familiar with local labor dispute practice are also welcome to open issues or pull requests.

A Thought for Lawyers

We used to think that a lawyer’s technological transition mainly meant learning to use legal databases, writing prompts, or asking AI to draft contracts. After building this tool, I increasingly feel that the more valuable work is not limited to “letting AI write text for us.” It also includes turning the structured parts of legal services into products.

Of course, not every legal question needs software, and not every legal judgment is suitable for automation. But issues like severance pay have relatively clear rules, limited variables, and high consultation frequency. They are well suited to a low-barrier tool.

More importantly, vibe coding lowers the cost of trying. A lawyer does not have to quit their job and spend three years learning front-end development before testing an idea. If you can explain the rules clearly, review the logic generated by AI, and point out what is wrong when the result is off, you can already start building a prototype.