2026-06-26 · Miky Bayankin
Stock Purchase Agreement Template: How to Write a Stock Purchase Agreement
A practical guide to drafting a stock purchase agreement: representations, indemnification, closing conditions, escrow, and stock vs. asset deals.
A stock purchase agreement (SPA) is the document that turns "we agreed on a price" into an actual change of ownership. When someone buys a company by buying its shares, rather than its individual assets, this is the contract that governs the deal: who is selling what, for how much, what each side promises, and what happens if those promises turn out to be wrong.
It is also one of the easier contracts to get badly wrong. A handshake price and a one-paragraph bill of sale leave the buyer exposed to liabilities they never agreed to absorb and leave the seller on the hook for warranties they never meant to make. This guide walks through how a stock purchase agreement is structured, what each section needs to say, and the mistakes that cause these deals to fall apart after closing.
What a Stock Purchase Agreement Does
A stock purchase agreement transfers ownership of a corporation by selling its shares. The buyer steps into the shoes of the previous shareholders and takes the company as a going concern: same legal entity, same tax ID, same contracts, same bank accounts, and the same liabilities.
That last point is the whole reason the document gets detailed. Because the company continues unchanged, the buyer inherits everything attached to it, including debts, pending lawsuits, and tax exposure that may not surface for months. The SPA is where the buyer protects against that inheritance and where the seller draws a clear line under what they are and are not responsible for.
SPAs show up in a wide range of deals:
- An owner selling 100 percent of a small business to a single buyer
- An investor buying a minority stake in a growing company
- One co-founder buying out another
- A larger company acquiring a competitor or supplier
The mechanics are the same whether it is a $50,000 buyout or a multimillion-dollar acquisition. Only the depth of the warranties and the size of the escrow really change.
Stock Purchase vs. Asset Purchase
Before drafting anything, decide whether the deal is actually a stock purchase. The alternative is an asset purchase, where the buyer acquires specific assets, equipment, customer lists, intellectual property, and inventory, and usually leaves the legal entity and most of its liabilities behind.
The trade-off usually breaks down like this:
- Buyers often prefer an asset deal. They take only what they want and can walk away from unknown liabilities, and they get a stepped-up tax basis in the assets.
- Sellers often prefer a stock deal. It is a cleaner exit, it transfers the liabilities along with the company, and it frequently produces better capital gains treatment.
If the company holds licenses, permits, or contracts that are hard to reassign, a stock deal can be simpler because those agreements stay with the entity. If the worry is hidden liabilities, an asset deal limits the buyer's exposure.
There is also a middle path worth knowing about. In some U.S. deals, the parties make a joint tax election (a Section 338(h)(10) election, for eligible S corporations and certain subsidiaries) that legally keeps the stock structure while letting the buyer treat the purchase as an asset acquisition for tax purposes. It is not right for every deal, and it usually needs an accountant's input, but it can resolve the buyer-seller tug of war over structure without forcing one side to give up everything. For a deeper comparison of the asset route, see our guide on writing an asset purchase agreement. If you are buying an entire operating business and weighing both structures, the business purchase agreement guide covers the broader framework.
Key Sections of a Stock Purchase Agreement
1. Parties and Recitals
Name the buyer, the seller or sellers, and the company whose shares are changing hands. Use full legal names and, for entities, the state of incorporation. The recitals state plainly what is happening: the seller owns a stated number of shares and agrees to sell them to the buyer on the terms that follow.
If several shareholders are selling, list each one and the exact number of shares each holds. A common error in closely held companies is treating the "owners" as a single block when they actually hold different share counts and may have different consent rights.
2. The Shares and the Purchase Price
Spell out exactly what is being sold: the number and class of shares, and the percentage of the company they represent. Then set the price and how it is paid.
Payment structures vary:
- Lump sum at closing is the simplest and cleanest for the seller.
- Installments or seller financing spread payment over time, often with interest and a security interest in the shares.
- Earnout ties part of the price to the company hitting future revenue or profit targets.
If any part of the price is contingent or deferred, define the formula precisely. Earnout disputes are among the most common sources of post-closing litigation because the language was vague about how performance is measured.
3. Representations and Warranties
This is the heart of the agreement. Representations and warranties are factual statements each side makes and the other relies on. They allocate risk: if a statement is false, the harmed party has a claim.
The seller typically warrants that:
- They own the shares outright, free of liens, pledges, or transfer restrictions
- The company is properly organized and in good standing
- The financial statements provided are accurate and complete
- There is no undisclosed litigation, debt, or tax liability
- Material contracts are valid and not in default
- The company owns or licenses the intellectual property it uses
The buyer typically warrants that they have the authority and the funds to complete the purchase, and that they are buying for their own account rather than for resale in violation of securities law.
Sellers should resist warranties that are broader than they can stand behind. Buyers should resist a deal with thin warranties. The negotiation here is where most of the value protection lives. A disclosure schedule, attached to the agreement, lists the specific exceptions to each warranty so the seller is not caught out by a known issue they already revealed.
4. Covenants
Covenants are promises about behavior, often covering the gap between signing and closing. The seller commonly agrees to run the business normally in the interim, not to take on new debt, not to pay unusual dividends, and to give the buyer access for due diligence. Post-closing covenants might include a non-compete, an agreement to help with the transition, or confidentiality obligations.
5. Closing Conditions
These are the boxes that must be checked before either side is obligated to close. Typical conditions include:
- The representations remaining true as of the closing date
- Required third-party or regulatory consents being obtained
- No material adverse change in the business
- Delivery of the stock certificates, stock powers, and corporate records
If a condition is not met, the affected party can usually walk away without penalty. Define each condition clearly so there is no argument later about whether closing was required.
6. Indemnification
Indemnification is the remedy that gives warranties teeth. If a warranty turns out to be false and the buyer suffers a loss, this clause is how they recover.
Watch for these moving parts:
- Survival period. How long after closing the warranties remain enforceable, often 12 to 24 months, with tax and fundamental warranties surviving longer.
- Caps and baskets. A cap limits the seller's total exposure, often to a percentage of the purchase price. A basket sets a minimum threshold of losses before any claim can be made, filtering out trivial disputes.
- Escrow or holdback. Holding back part of the price secures the buyer's indemnification rights without chasing the seller for payment later.
7. Governing Law, Disputes, and Signatures
State which jurisdiction's law applies and how disputes are resolved, whether by litigation in a named court or by arbitration. Both parties sign, and any signatory acting for an entity must have authority to bind it.
How to Write a Stock Purchase Agreement: Step by Step
Step 1: Confirm the deal structure. Decide stock vs. asset, and confirm the share count, classes, and percentages being sold. Pull the company's cap table and stock ledger so the numbers match reality.
Step 2: Clear transfer restrictions. Check the bylaws, the shareholder agreement, and any buy-sell agreement for rights of first refusal, drag-along rights, or consent requirements. Resolve them before drafting, not after.
Step 3: Set price and payment terms. Fix the number, then decide whether it is paid at closing, over time, or partly through an earnout. Write the payment formula in plain language.
Step 4: Draft the representations and warranties. Start from the standard list above, then tailor it to the company. Attach a disclosure schedule for known exceptions.
Step 5: Add covenants and closing conditions. Cover the signing-to-closing gap and list everything that must happen before the deal closes.
Step 6: Build the indemnification framework. Set the survival period, cap, basket, and any escrow. This is where buyer and seller protections balance out.
Step 7: Handle the share transfer mechanics. Prepare stock powers or assignments, update the stock ledger, cancel old certificates, and issue new ones or book entries. The contract authorizes the transfer; these documents actually carry it out.
Common Mistakes to Avoid
Skipping due diligence. A buyer who signs without reviewing financials, contracts, and litigation history is buying blind. Often the company shares this information under an NDA before the SPA is drafted; if confidentiality matters, sign one first using our non-disclosure agreement guide.
Vague earnout language. "Based on performance" is not a formula. Define the metric, the measurement period, who calculates it, and what happens if the buyer changes how the business operates.
Ignoring transfer restrictions. Selling shares that are subject to a right of first refusal or a transfer ban can void the sale and expose the seller to a claim from the other shareholders.
No disclosure schedule. Warranties without a schedule of exceptions force the seller to either lie or break the warranty. The schedule is how known problems are disclosed without creating liability.
Forgetting the stock ledger. A signed SPA does not by itself move the shares. If the ledger and certificates are not updated, ownership stays ambiguous, which is exactly the problem the deal was supposed to solve.
Treating liabilities as someone else's problem. In a stock deal, the buyer inherits the company's debts and obligations. The indemnification and warranty sections are the only real protection, so they deserve careful attention rather than boilerplate.
When You Need a Stock Purchase Agreement
- Buying or selling a corporation through its shares rather than its assets
- A co-founder buyout where one owner acquires another's stake
- An investor taking an equity position in an existing company
- An acquisition where keeping the entity intact preserves valuable contracts or licenses
If the company is still raising early capital rather than changing hands, a SAFE agreement is usually the right instrument instead, since it defers the share question to a future priced round.
Related guides
- Private Placement Stock Offering: Investors Guide
- Power Purchase Agreement Template (PPA)
- How to Write a Purchase Order (+ Template)
- Blanket Purchase Agreement: How to Write One
- Lease Purchase Agreement Template: How to Write One
Generate Your Stock Purchase Agreement with Contractable
A stock purchase agreement has a lot of moving parts, and the gap between a solid one and a risky one is in the details: the warranties, the indemnification caps, the closing conditions, and the transfer mechanics. Contractable generates a customized stock purchase agreement in minutes, with the right structure for your deal size and the clauses that protect both sides. No legal background required.
Ready to create your contract?
Describe your situation in one sentence and we'll generate a custom contract for you instantly.
Generate your contract →Popular templates: NDAIndependent Contractor AgreementService Agreement