GL codes explained: How accounting codes organize your books

Every time money moves through your business, it has to be recorded against a specific account. Software charges are filed under “Software,” customer payments under “Revenue,” and so on. GL codes are how you connect each transaction to the right account.
Get the coding right, and your financial statements will come together with little effort. Get it wrong or skip it, and you’ll end up relabeling months of transactions before your next board meeting.
If you’re adding structure to your accounting for the first time, GL codes are worth nailing down early. Read on to learn the answers to common questions like:
- What is a general ledger code?
- What do GL codes look like?
- How do GL codes differ from accounts and the chart of accounts?
- How do I build a coding structure?
- What common coding mistakes do founders make?
- When should I expand my GL coding structure?
- How do GL codes make categorization and reporting easier?
What is a GL code?
A GL code is part of a larger accounting structure. Every account, whether it’s “Cash” or “Software,” sits inside a chart of accounts — the full list of accounts used by a business. All of those accounts, together with every transaction recorded in them, make up the general ledger.
What are GL codes, then? GL codes (also known as general ledger codes) are short alphanumeric identifiers assigned to each account in that ledger. When you record transactions, GL codes tell your accounting system which accounts to categorize them under: cash, accounts payable, subscription revenue, etc. Essentially, they’re the numbers that label your accounts — that’s the GL code definition at its most basic.
What do GL codes look like?
There’s no single numbering system used by every business, but many companies group GL codes by account type. It might look something like this (where the first digit represents the account type):
- 1000s for assets
- 2000s for liabilities
- 3000s for equity
- 4000s for revenue
- 5000s and 6000s for expenses, split into cost of goods sold (COGS) and operating expenses (OpEx)
Within those ranges, each account gets its own code. For example, a business might use 1010 for “Cash” and 1100 for “Accounts Receivable”. Both fall within the 1000s, making it easy to see at a glance that they’re asset accounts.
COGS and OpEx are both expense accounts, but they get separate ranges because they have different purposes. COGS feeds your gross margin (i.e., what’s left of your revenue after covering the direct cost of delivering what you sell) and OpEx accounts cover everything else you spend to run the business.
Some businesses use alphanumeric codes or add digits for departments or locations. For example, a company might use 6020-01 for “Marketing - New York” and 6020-02 for “Marketing - Los Angeles”. But most early-stage teams don’t need that level of detail; a clean four-digit number per account is usually enough.
How do GL codes work?
Coding a transaction sets off a chain of events. Say your software account has been assigned the GL code 6010. If you need to document a $200 software charge, you’d start by labeling the charge with 6010. That tells your accounting system to post the charge to the software account, increasing its balance by $200. That total then flows onto your income statement under operating expenses.
It looks like this: 6010 Software and tools → operating expenses → income statement
Using the wrong code sends the transaction to the wrong account. For example, if you tag that same charge 6020 for marketing, it leaves your software spend understated and your marketing spend overstated. That’s what makes it important to understand two particular distinctions: how a code differs from the account it’s attached to, and how those codes relate to the chart of accounts as a whole.
GL code vs. general ledger account: What’s the difference?
A general ledger account groups transactions based on their category (like “Accounts payable,” for example) and maintains a running balance. The GL code is simply the identifier assigned to the account. Both are necessary — the account gives transactions a home, and the code makes that home easy to reference, sort, and report.
GL codes vs. chart of accounts: How do they fit together?
Zooming out, all of those individual accounts make up your chart of accounts. Think of it as the complete list of accounts your business uses, organized by their GL codes. The codes help your accounting software figure out where to record each transaction and, together, form the structure of your coding system.
How to create a GL coding structure for your business
GL coding is the practice of assigning the right code to each transaction so it lands in the correct account. Building a structure around it isn’t complicated. It comes down to making a handful of one-time decisions, then sticking to them. Here’s a step-by-step guide.
Step 1: Start from your account list
Group your accounts by type — e.g., assets, liabilities, equity, revenue, and expenses — and assign each type a range (1000s, 2000s, and so on) before you number individual accounts.
Step 2: Add numbers within each range
Number your account list in increments of 10 (6000, 6010, 6020) or 20 (6000, 6020, 6040). Leaving gaps between codes gives you room to add new accounts in the right place later without having to renumber the original ones.
Step 3: Map charges to accounts
Match each common charge to an account so that recurring expenses like payroll, subscriptions, and processor fees are coded the same way every time.
Step 4: Code charges as they come in
To keep accounts payable running smoothly, it’s best to categorize transactions as they come in. You might not remember what a vendor charge was for by month-end.
Try to set up the simplest GL coding structure you can, while still making sure it tells you everything you need to know. For example, an early-stage business may only need one software account rather than separate accounts for project management, communication, design, and other types of software. It’s much better to have a short, consistent set of accounts that you actually maintain over an exhaustive one that drifts.
A simple GL coding example for an early-stage startup
If you’re having trouble visualizing how a GL coding system comes together, here’s a simple example for a pre-seed or seed-stage startup.
GL code | Account | Type |
|---|---|---|
1000 | Cash | Asset |
1010 | Accounts receivable | Asset |
2000 | Accounts payable | Liability |
3000 | Common stock | Equity |
4000 | Subscription revenue | Revenue |
5010 | Payment processing fees | COGS |
6010 | Software and tools | Operating expense |
Each account is assigned a code from the number range for its account type. For example, “Cash” and “Accounts receivable” are both assets, so they’re assigned codes in the 1000s. “Software and tools” is an operating expense, so it gets assigned a code in the 6000s. A relatively small set of accounts is usually enough at the early stage.
Common GL coding mistakes to avoid
Once you’ve set up your GL coding structure, the next step is using it consistently. Watch for these common bookkeeping mistakes that can cause even a good structure to drift over time.
Too many accounts
Spreading spend across dozens of narrow accounts makes transactions easy to misfile and reports hard to read. Use broader accounts unless you actually need the additional detail for reporting.
Inconsistent coding
When the same expense gets routed to different accounts every month, it becomes harder to track trends and trust your own numbers. For example, if the same software subscription is coded to “Software” one month and “General” the next, your reports won’t give you a reliable picture of software spend.
Overusing a catch-all
It’s okay to use a miscellaneous account once in a while, but if too many expenses end up there, you lose visibility into what you’re actually spending money on.
Copying a template without customizing
An off-the-shelf chart of accounts may include accounts you’ll never use, and leave out ones your business needs, so the books never quite fit. Use a template as a starting point, then tailor it to how your business actually earns and spends money.
If your coding has already slipped, Mercury’s bookkeeping clean-up checklist can help.
How GL codes make expense categorization and reporting easier
Reporting time is when consistent GL codes for accounting really pay off. When each expense carries a code, your accounting software can total categories instantly. That means expenses like software spend, contractor costs, and processing fees show up as clean line items instead of raw, unsorted transactions. Consistent coding also makes it easier to spot trends, since similar transactions are grouped in the same accounts over time.
Most accounting platforms also provide GL coding automation. By learning your patterns and automatically assigning codes, automated GL coding needs fewer corrections over time.
But remember: Automated coding works best when it has accurate, consistent data to work from. If your bank and card transactions come from different providers, vendor names and categories may not match.
When should you update or expand your GL coding structure?
Your coding structure should change when your business does. Here are a few indicators to watch for.
Indicator #1: You’ve added a revenue stream
A new product or pricing model may warrant its own revenue account if you need to track its performance separately.
Indicator #2: You’ve raised a priced round
A priced round may require changes to your equity accounts so your chart of accounts accurately reflects the new financing and share structure.
Indicator #3: You keep fixing the same miscodes
If you’re repeatedly making corrections, you may be missing a necessary account, using unclear coding rules, or relying on an automation that needs to be adjusted.
Outside those moments, GL codes are quite easy to maintain. Checking your coding monthly and requiring approval on larger payments — a basic form of internal controls — is generally enough to catch issues before they reach your statements. It also helps to ensure your accounting software matches your needs.
Keep your GL codes useful as your business grows
GL codes probably aren’t at the top of your to-do list, but they are the foundation beneath every report you’ll ever run. A simple structure, applied consistently and expanded only when necessary, can carry you from your first small transactions to major board meetings without requiring a rebuild. Set it up early while there’s less to track, keep the coding consistent, and let the structure grow alongside your business.
Learn more about setting up categories in your Mercury account today.
Related reads

What is a general ledger? A practical guide for founders

Ecommerce bookkeeping: Inventory, revenue, refunds, and fees

How to make your books investor-ready
