Invoice Data Extraction Logo
Invoice Data Extraction
Start Extraction
Pricing
Extraction Guide
API
Sign inCreate account
Sign inCreate account
Start Extraction
Pricing
Extraction Guide
API
  1. Home
  2. Articles & Analysis
  3. Invoice Fundamentals
  4. What Is a GL Code? Structure, Examples, and Who Assigns It

What Is a GL Code? Structure, Examples, and Who Assigns It

A GL code is the general ledger account your accounting team assigns to a transaction. It isn't on the supplier's invoice — see why, and how codes are built.

Published
Aug 8, 2026
Updated
Aug 8, 2026
Reading Time
18 min
Author
David Harding
Topics:
Invoice FundamentalsGL codingchart of accountsgeneral ledgeraccounting basics

On this page

A GL code (general ledger code) is the account number a business assigns to a transaction so it posts to the correct account in its general ledger. Office supplies might be coded 5020; an unpaid supplier bill might sit in 2010, accounts payable.

If you are looking for a GL code on a supplier's invoice, stop looking. It is not there, and it will never be there. The supplier issues the same document to every customer it sells to, and it has no visibility into your organization's accounts. The code is applied afterwards, by your accounting team or your accounts payable system, when the invoice is processed.

That is the part almost nobody says out loud, and it is usually the real question behind what is a GL code. The code is not a piece of information you extract from the document. It is a decision someone at your end makes about the document.

So when a form field demands one, the answer comes from your own organization. Specifically, from three places: the account list inside your accounting software, a colleague in finance who maintains that list, or an internal coding guide if your organization has written one. Someone in your business decided that office supplies are 5020. A supplier in another city had no way of knowing that.

The numbers themselves follow a convention. Accounts are grouped in thousands by class: 1000s for assets, 2000s for liabilities, 3000s for equity, 4000s for revenue, 5000s for expenses. Every business sets its own numbering inside those ranges, which is why your 5020 is someone else's stationery account and someone else's 5020 is postage.

One quick disambiguation before going further: this is an accounting term, unrelated to the G-code that drives CNC machining equipment.

General Ledger and Chart of Accounts, Defined

The general ledger is the central record of every financial transaction a business makes, organized by account rather than by date or by supplier. Every sale, every purchase, every payment and payroll run lands there. When an accountant produces the year-end figures, they are reading the general ledger.

The chart of accounts is the numbered list of accounts that ledger is organized into. It is where 5020 becomes office supplies and 2010 becomes accounts payable. Without it, the ledger is a pile of transactions with no structure; with it, the business can answer questions like what it spent on software last quarter. The list belongs to the business. Someone set it up, and someone maintains it.

A GL code, then, is an address. Coding a transaction means choosing which account in the chart of accounts it belongs to, and that choice determines where the amount appears in the financial statements.

This is worth being concrete about, because it is the reason coding matters at all. Take a single $4,000 payment. Code it to a marketing account and it becomes a marketing cost that reduces this year's profit and shows up against the marketing team's budget. Code it to an IT account and the same $4,000 becomes an IT cost instead. Code it to a fixed asset account and it stops being a cost this year altogether, sitting on the balance sheet and hitting the income statement gradually as depreciation. Same payment, same supplier, same amount, three different sets of reported numbers.

That difference tracks the split between the two statements. Assets, liabilities and equity accounts sit on the balance sheet, which shows what the business owns and owes at a point in time. Revenue and expense accounts sit on the income statement, or P&L, which shows performance over a period. The class an account belongs to decides which statement the amount reaches, and the numeric ranges follow that split directly.

Accounts payable is a useful illustration of a liability account in action. When a supplier invoice is approved but not yet paid, the amount does not disappear until payday. It sits in the accounts payable account as money the business owes, then clears when the payment goes out. If you are new to this, it is worth understanding what accounts payable means as a liability account before working through invoice coding, because almost every supplier invoice touches that account on one side of the entry.

One clarification that saves confusion later: a GL code identifies an account, not a supplier, a project or a department. Those dimensions are real and businesses do track them, but they are handled by additional segments alongside the account number rather than by the account number itself.

How a GL Code Is Built: Classes, Ranges, and Segments

Five account classes cover everything a business records: assets, liabilities, equity, revenue and expenses. The numbering convention maps onto them consistently enough that you can usually read the class off the first digit alone.

According to the Office for Victims of Crime's chart of accounts guide sheet, chart of accounts numbers are usually grouped in thousands by class, with 1000s for assets, 2000s for liabilities, 3000s for equity, 4000s for revenues and 5000s for expenses, and each entity creates its own list of account names and numbers. Both halves of that matter. The ranges are a genuine convention you can rely on, and the specific numbers inside them are always the organization's own invention.

Within a class, individual accounts occupy specific numbers. The 5000 expense class might hold 5020 for office supplies and 5410 for software subscriptions. The leading digit tells you the class; the digits after it identify which account inside that class.

Look at a real account list and you will notice the numbers do not run consecutively. That is deliberate. Gaps are left so a new account can be slotted in near related ones later without renumbering everything downstream, which would break every historical report and every saved mapping that depends on those numbers.

Segments: one string, several dimensions

A bare account number tells you what kind of cost something is. Most organizations of any size need to know more than that: which department incurred it, which site, which project. Rather than creating separate accounts for every combination, which would produce thousands of accounts, they extend the code with additional segments.

A cost center is the usual first extension. It is an internal unit that owns a budget, such as a department, a site or a team, and it answers the question of whose cost this is.

Two worked examples, with each part explained:

5410-220-NY1

  • 5410 is the base account: software subscriptions, an expense
  • 220 is the cost center: the engineering department
  • NY1 is the location: the New York office

Read as a whole, that string says a software subscription cost incurred by engineering at the New York office. It posts to a single expense account, but it can be reported on by department and by site.

5230-140-CHI-J2208

  • 5230 is the base account: contract labor
  • 140 is the cost center: marketing
  • CHI is the location: the Chicago site
  • J2208 is the project or job reference: a specific campaign

The fourth segment is what makes project reporting possible. Without it, the finance team can tell you what marketing spent on contract labor in Chicago, but not what a particular campaign cost.

Segment count, segment order and separator characters are all organization-specific. Some use hyphens, some use dots, some run segments together with no separator at all. Some put the cost center first and the account second. If a code you are shown looks nothing like the examples above, it is almost certainly a different segmentation scheme rather than a different concept, and reading it is a matter of finding out what each position means in your organization.

The GL code list

In practice, coders work from a list. It is an export or printout of every active account, showing the number, the account name and often a short description of what belongs in it. In accounting software it usually sits under a menu item called chart of accounts or account list.

If you have been asked for a GL code and have no idea what your options are, that list is the thing to ask for by name. Requesting the chart of accounts export, or the GL code list, from whoever maintains the books is faster than guessing, and most finance teams would rather send it than fix a miscoded invoice later.


What on the Invoice Actually Determines the Code

The document does not carry the code, but it carries the evidence the code is derived from. GL coding is the act of reading specific fields on the invoice and matching what they tell you against the chart of accounts. Different fields feed different segments, and knowing which field drives which part of the code is most of the skill.

Vendor identity. Many suppliers sell one kind of thing. An invoice from a commercial cleaning company is a cleaning cost whatever the line items say. Because that relationship is stable, organizations store a default GL code against the supplier record in the vendor master, so the code prefills the moment the invoice is matched to that supplier. This is genuinely useful and it is also the single most common source of quiet errors, because plenty of suppliers sell across categories. A large office supplier might invoice you for paper, a desk chair and a printer in the same month, and those are not all the same account. A default prefill is a starting point to check, not an answer.

Line-item descriptions. These are the strongest signal on the document, and where a description conflicts with a vendor default, the description wins. It is what determines the base account number: "24-month domain renewal" is a different account from "replacement laptop battery" regardless of who sent the invoice. Reading down the line items is the core of the coding decision, and it is one of the fields captured during invoice data entry precisely because everything downstream depends on it.

Cost center or department reference. This is whatever the buyer supplied at the point of ordering and the supplier reprinted back: a requisitioner name, a department name, an internal reference in the "your reference" field. It feeds the department segment. If it is absent, the usual fallback is working out who ordered the thing, which is slower and less reliable than having the field populated in the first place.

Project or job number. Where it appears on the document, it populates the project segment directly. Job numbers are the reason project profitability reporting exists at all: without one on the invoice, costs get absorbed into departmental totals and nobody can say afterwards what a specific build, campaign or client engagement actually cost.

Ship-to address. This drives the location segment, and it is worth being careful here because ship-to and bill-to frequently differ. Invoices are commonly billed to a head office and delivered to a branch, warehouse or site. The bill-to address tells you which legal entity is being invoiced; the ship-to tells you where the cost was actually incurred, and that is the one the location segment needs.

Purchase order reference. Where an invoice quotes a PO number, the coding decision was largely made at requisition. Somebody chose the account, department and project when they raised the order, and the invoice inherits that coding rather than having it re-derived. This is why PO-backed invoices code quickly and consistently. A non-PO invoice has none of that inherited structure, so every segment has to be worked out from the document and from whoever approved the spend, which is why coding accuracy on non-PO invoices is consistently worse.

There is one thing the invoice cannot tell you at all. Whether a purchase is an expense or a capitalized asset depends on your organization's capitalization threshold and its policy, not on anything printed on the page. A $900 laptop is an expense in a business with a $1,000 threshold and a fixed asset in one with a $500 threshold. The identical invoice codes to a different account class in the two organizations.

Doing this for one invoice is a reading exercise. Doing it for several thousand a month, consistently, across suppliers who all format their documents differently, is a different problem with its own tooling and controls. That is covered separately in how AP teams assign GL codes to supplier invoices at scale.

When One Invoice Needs More Than One Code

A single form field asking for a GL code implies one invoice, one code. That implication is wrong often enough to be worth correcting directly: a GL code applies to an amount, not to a document. An invoice carrying several kinds of cost needs several codes.

Take a supplier invoice with three lines: four laptops at $1,200 each, a set of monitor stands at $180, and an annual license renewal for the software those laptops run. Three lines, three different destinations. The license is a software subscription expense. The monitor stands are equipment or office expense. The laptops, at $1,200 apiece, sit above the capitalization threshold in most organizations and belong on the balance sheet as fixed assets rather than on the income statement at all. Coding that invoice to one account puts at least two of those three in the wrong place.

Header-level coding applies one account to the invoice total. It is the right approach when the invoice genuinely is one kind of cost, which covers a large share of supplier invoices: a rent invoice, a utility bill, a single professional services fee. The problem is that when it is applied to a mixed invoice, the error becomes invisible. The ledger shows a single clean entry against one account. Nothing about it looks wrong afterwards, because the detail that would reveal the mistake was discarded at the point of coding.

Line-level coding assigns an account to each line individually. It takes longer, and it preserves the information. This is the same exercise as sorting invoice line items into expense categories in a spreadsheet, just performed inside the accounting system rather than alongside it, and it is why line-item detail is worth capturing rather than summarizing to an invoice total.

Allocation is the related case, where a single line is shared across several parts of the business. A software subscription used by three departments, or a building's electricity bill covering four teams, does not belong wholly to any one cost center. Systems handle this by splitting the line across cost centers, either by percentage (40/35/25) or by fixed amount. Two things matter mechanically: the split must total the line amount exactly, or the entry will not post, and the split ratios need a defensible basis such as headcount, floor area or license count, because someone will eventually ask why marketing carries 40 percent of it.

What happens underneath is that the accounting system records multiple ledger entries against one invoice document. The invoice still reconciles to a single supplier balance and a single payment, while the cost appears in several accounts and against several cost centers in the reports. This is why a department can be charged for part of an invoice it never saw.

None of this means every mixed invoice needs splitting. Most organizations set a materiality threshold below which the effort is not worth it, and a $15 stationery line on an otherwise clean invoice gets absorbed rather than allocated. What decides it is whether the misplacement would change somebody's decision.

What Goes Wrong When the Code Is Missing or Incorrect

Nothing catastrophic happens if you get a code wrong. Everything here is fixable, and finance teams fix these constantly. But the consequences are worth naming precisely, because they explain why the field is being enforced.

No code at all. An uncoded invoice cannot post to the ledger, so it sits in a hold, exception or suspense queue until someone supplies one. The practical effects are delayed approval, delayed payment, an irritated supplier, and the risk that a cost incurred in one month gets recorded in the next because it was still stuck in the queue at period end.

Wrong account, right class. The invoice posts and the totals are correct, but a training course coded to travel means training spend is understated and travel is overstated. Nothing is out of balance and nothing gets flagged. The error shows up only when someone questions a category figure, which may be at the annual budget review or not at all.

Wrong department or cost center. This is the error most likely to be found, because it lands on somebody's own numbers. A budget owner reviewing their monthly P&L sees costs they do not recognize, while the department that actually incurred the spend looks comfortably under budget. Both readings are wrong, and both feed into decisions about where money goes next.

Wrong class entirely. Coding a capitalizable asset as an expense, or an expense as an asset, changes when the cost hits the income statement. An asset spreads across several years through depreciation; an expense lands immediately. That shifts reported profit in both years, affects the depreciation schedule, and can carry tax consequences. Auditors look for exactly this, and it is the category of error most likely to require restating a published figure.

The cleanup: a reclassification journal. Once an entry is posted, it is not deleted or overwritten, because the ledger's audit trail depends on entries being permanent. The correction is a journal that moves the amount from the wrong account to the right one, leaving both the original entry and the correction visible. This is routine work, but it is manual, it needs review, and it almost always happens during month-end close when the finance team has the least capacity for it.

Budget versus actual. For as long as the error stands, comparisons against budget are wrong for at least two accounts: the one carrying the cost it should not have, and the one missing the cost it should. Coding exists to make those comparisons meaningful, so a miscode undermines the exact thing it was supposed to support.

Worth knowing about one compounding case: a wrong default code on a supplier record does not misfire once. It repeats silently on every invoice from that supplier, month after month, until somebody spots the pattern in the reports.

Where Your GL Codes Come From If You Don't Have a Chart of Accounts Yet

Setting up books for the first time, you do not start from a blank page. Accounting software ships a default chart of accounts during setup, usually shaped by the business type you select, and it arrives already numbered along the standard class ranges. Most small businesses adopt that default and extend it rather than designing a numbering scheme from scratch, which is the sensible move: the default already covers the accounts a business of that type actually uses.

Extending it works best conservatively. Add an account only when nothing existing genuinely fits, and resist the instinct to create one per supplier or one per minor cost type. An oversized chart of accounts is harder to code against, because whoever is coding has more near-identical options to choose between and will not choose consistently, and it makes reporting noisier by scattering related costs across accounts that should have been one. Fifteen well-defined expense accounts beat sixty overlapping ones.

There is no universal standard chart of accounts in the US or the UK, which is the structural reason a supplier cannot print a GL code on an invoice: there is no shared list for them to draw one from. Even a supplier who knew your industry perfectly would be guessing at numbers only your organization holds.

It is not universal, though. Some jurisdictions do prescribe national standard charts, and Germany is the clearest example: Germany's SKR03 and SKR04 standard charts of accounts give businesses a shared numbering framework, so an account number carries comparable meaning from one company to the next in a way it simply does not in the US or UK. Accountants working across German businesses can read a code without asking what the numbering scheme is.

Prescribed structures also appear at sector level. Grant-funded organizations frequently have to report against an account structure set by the funder, and regulated sectors often work to a framework imposed by their regulator. In those cases the chart of accounts is inherited rather than chosen, and the coding rules that come with it are usually stricter than anything a business would impose on itself.

If you arrived here stuck on a single form field, the practical move is to ask whoever maintains the books for the chart of accounts export by name, then find the line that matches what was actually bought.

Invoice Data Extraction

Extract data from invoices and financial documents to structured spreadsheets. 50 free pages every month — no credit card required.

Try It Free
Continue Reading

Related Articles

Explore adjacent guides and reference articles on this topic.

Invoice GL Coding: A Complete Guide to Accurate Account Assignment

Master invoice GL coding from data extraction to account assignment. Covers common errors, automation options, and strategies by chart of accounts complexity.

What Is Accounts Payable? Definition, Example, and Process

Learn what accounts payable means and where it appears. Follow a supplier invoice from a current liability through payment and clearing.

SKR03 vs SKR04: German Chart of Accounts Explained

English guide to SKR03 vs SKR04, with chart structure, invoice coding, DATEV handoff, ERP mapping, and when each setup fits best.

Back to Articles & Analysis

Invoice Data Extraction

The AI-native automation platform for high-accuracy invoice extraction

Platform

  • Start Extraction
  • Home
  • Pricing
  • API
  • Python SDK
  • Node.js SDK

Solutions

  • Invoice to Excel
  • Invoice OCR Software
  • Bank Statement Converter
  • Receipt OCR
  • Utility Bill Extraction
  • Payroll Data Extraction
  • PDF Data Extraction

Resources

  • Articles
  • Contact

Trust & Security

  • Security
  • Subprocessors
  • AI Data Use

Legal

  • Terms of Service
  • Data Processing Addendum
  • Privacy Policy
  • Refund Policy
  • US State Privacy Rights
  • EEA/UK Privacy Rights
English
Sign inCreate account

© 2026 Invoice Data Extraction — DEH Technologies LLC

Secure by Design. Your data is never used for AI training.