GL Coding Explained
Jun 28, 2026
Try it now: upload an invoice and get the data in Excel or CSV
PDF, JPG, PNG, BMP, HEIC, TIFF
Upload your invoices
Drop files here or click to upload
Up to 50 files
Uploading...
GL coding is how accounting teams turn a pile of invoices and expenses into financial statements that actually mean something. Every time a bill comes in, someone has to decide which general ledger account it belongs to, which department or cost center it hits, and which period it lands in. That decision is the GL code. This guide explains what GL codes are, how the numbering works, real accounts payable examples, who assigns them, and how to code invoices faster without the manual lookup that slows most AP teams down.
What is GL coding?
GL coding is the practice of assigning a general ledger account code to each financial transaction so it posts to the right place in your books. A GL code is a short alphanumeric identifier that maps a cost or revenue item to a specific account, and often to a department, cost center, project, or location as well. In accounts payable, GL coding happens right after an invoice is received: you tag the bill, or each line on it, with the account that should absorb the expense.
Without consistent GL coding, your income statement and balance sheet drift away from reality. A software subscription tagged to the wrong account inflates one budget and starves another, and at month end the numbers no longer match what actually happened. Good coding is what lets a controller trust a report without re-checking every line.
What does GL stand for in coding?
GL stands for general ledger. The general ledger is the master record of every account a business uses to track money, and a GL code is the unique number that points to one of those accounts. So "GL coding" simply means labeling a transaction with its general ledger account number. The term has nothing to do with software programming, even though the same letters show up in other contexts.
What are GL codes used for?
GL codes exist to sort every dollar into the right bucket so reports are accurate and comparable over time. They let you group spend by category (rent, software, freight, professional fees), roll costs up by department or cost center, build budgets you can hold people to, and feed clean numbers into tax filings and audits. In AP specifically, the code on each invoice decides which expense account and which part of the org the cost lands against.
The same codes drive analysis later. When a CFO asks why marketing spend jumped in Q2, the answer comes from invoices that were coded correctly to the marketing accounts in the first place. Coding is the input; every report downstream depends on it.
What is a GL code in accounting?
In accounting, a GL code is the account number from your chart of accounts that classifies a transaction by type. The chart of accounts is the full list of accounts a business uses, and each one carries a code. When you record a transaction, you reference its GL code so the entry posts to that account. The code is the link between a real-world cost and its slot in the financial statements.
Most charts follow a numbering convention so the first digit signals the account type. A common pattern looks like this:
| Number range | Account type | Example accounts |
|---|---|---|
| 1000 to 1999 | Assets | Cash, accounts receivable, inventory, equipment |
| 2000 to 2999 | Liabilities | Accounts payable, accrued expenses, loans payable |
| 3000 to 3999 | Equity | Common stock, retained earnings, owner's equity |
| 4000 to 4999 | Revenue | Product sales, service revenue, interest income |
| 5000 to 6999 | Expenses | Rent, payroll, software, marketing, freight |
So accounts payable itself usually sits in the 2000 range as a liability (for example, 2010 Accounts Payable), while the expense each invoice represents is coded to a 5000 or 6000 account.
GL coding examples for accounts payable
In AP, GL coding means matching each invoice or line to the expense account that should carry the cost. A clean simple example: a $1,200 invoice from a SaaS vendor gets coded to 6100 Software Subscriptions; a $3,000 invoice from a law firm goes to 6300 Professional Fees; a freight bill goes to 5200 Freight and Delivery. The AP account (2010) is credited and the expense account is debited when the bill is posted.
Larger companies extend the code with extra segments so one number captures more than the account. A full string might read 6100-MKTG-NA-2026, where 6100 is the expense account, MKTG is the department, NA is the North America region, and 2026 is the fiscal year. Each added segment (fund, cost center, department, project, location) lets finance slice reports more finely later, but it also means more fields to get right on every invoice. Some sectors carry that segmentation further than most: law firms code to the client matter, which is where invoice extraction for legal starts, and providers split costs by department and facility, covered in invoice extraction for healthcare.
How do you GL code an invoice?
You GL code an invoice in four steps: read the invoice, identify what was purchased, look up the matching account in your chart of accounts, and enter that code (plus any required department or cost-center segments) on the invoice or each line item. For a single-purpose invoice you assign one code; for a mixed invoice you split it, coding each line to its own account so the totals still tie to the invoice.
- Capture the data. Pull the vendor, invoice number, dates, line descriptions, quantities, amounts, tax, and total off the bill, accurately, before you can code anything.
- Identify the expense. Decide what each line actually is: office supplies, consulting, equipment, travel.
- Match to the chart of accounts. Find the GL account that fits, and add the department, cost center, or project segments your company requires.
- Enter and route. Put the code on the invoice or each line, then send it for approval and posting.
The hardest part is usually step one. If the line items are buried in a PDF or a scan, coding stalls while someone retypes them. Pulling clean structured data first is what makes the rest fast, which is why teams use invoice line item extraction to turn each invoice into spreadsheet rows before coding. The deeper mechanics of tagging a single bill are covered in our guide to invoice coding.
Who does GL coding?
GL coding is usually done by accounts payable clerks or accounting staff when they process invoices, then reviewed by an AP manager or controller. In smaller businesses the bookkeeper or owner codes everything. In larger ones, the budget owner who approves an invoice often confirms or corrects the code, since they know best which project or cost center a charge belongs to. The accounting team owns the chart of accounts and sets the rules everyone codes against.
Are GL codes universal?
No, GL codes are not universal. Every business designs its own chart of accounts, so the same expense can carry different codes at different companies. There are common conventions, like assets in the 1000s and expenses in the 5000s, and frameworks such as US GAAP shape how accounts are grouped, but the exact numbers are yours to define. That is why a vendor cannot send you a pre-coded invoice; the code only makes sense inside your own chart.
What is a chart of accounts and how does it relate to GL coding?
The chart of accounts is the organized list of every GL account your business uses, and GL coding is the act of assigning items from that list to transactions. Think of the chart as the menu and coding as ordering from it. A well-built chart has enough accounts to give useful detail without so many that staff guess between near-duplicates. When the chart is clean and the codes are applied consistently, your reports stay accurate; when it is bloated or coded loosely, every downstream number suffers.
Why is GL coding so slow and error-prone?
GL coding is slow because it is manual judgment applied one invoice at a time, often against a chart with hundreds of accounts. A clerk reads each bill, decides the category, looks up the account, and types it in, and a single mis-key sends a cost to the wrong budget. Industry estimates put fully manual invoice handling at roughly $12 to $15 per invoice, much of it in this coding and keying work, with manual error rates near one in ten.
The errors compound. A miscoded invoice distorts a budget, triggers a variance investigation, and sometimes a correcting journal entry weeks later. Multiply that across thousands of invoices a month and coding becomes one of the biggest hidden costs in accounts payable.
How do you automate GL coding?
You automate GL coding by combining accurate data extraction with coding rules and AP software that remembers your patterns. First, AI reads each invoice and returns the vendor, line items, and amounts as structured data instead of you retyping them. Then your AP or ERP system applies coding rules (this vendor's charges default to 6100 Software, this cost center, this department) and learns from past coding, so most invoices arrive pre-coded for a human to confirm rather than build from scratch.
The extraction step is the foundation, and it is the part we handle: upload a PDF, scan, or photo and get clean header and line-item data ready for your accounting system. From there, accounts payable platforms add the coding rules and approval routing on top. See invoice data capture software for the capture layer, accounts payable automation software for the full AP workflow, and invoice data extraction software for the broader product. To put numbers behind the switch, our guide on how to automate invoice data entry walks through the savings.
Coding also depends on the documents feeding it. If your team matches invoices against purchase orders before coding, keeping clean PO data in a system like purchase order management software makes the right account obvious, and once invoices are coded and approved, accounts payable automation handles the approval and payment run that follow.
GL coding best practices
The teams that code fast and clean share a few habits. Keep the chart of accounts lean so staff are not guessing between five near-identical expense accounts. Document a coding guide that maps common vendors and spend types to accounts, so coding is a lookup, not a debate. Capture line-item data accurately before coding, since you cannot code what you cannot read. And let the budget owner who approves the invoice confirm the code, because they know which project the cost truly belongs to. Done together, these turn coding from a daily bottleneck into a quick confirmation step.