Key takeaways
  • No federal system maps a DUNS number directly to a NAICS code, because the government retired DUNS in April 2022 and replaced it with the UEI.
  • The working lookup path is SAM.gov Entity Search: find the company by UEI or legal name, open the registration detail page, and read its primary and secondary NAICS codes.
  • SAM.gov Entity Search is free and requires no login, but expired registrations hide NAICS codes until the entity renews.
  • NAICS codes on a SAM.gov registration can differ from state filing codes, and the SAM.gov list is the one that governs federal set-aside eligibility and SBA size standards.
  • PSC codes describe what the government is buying while NAICS codes describe what a company does, so the two never substitute for each other.

You cannot look up a NAICS code directly by DUNS number, because DUNS was retired from federal use in April 2022 and replaced by the UEI. The working method: run your NAICS code lookup through SAM.gov's entity search using the UEI or legal name, open the entity's registration detail page, and read the NAICS codes listed there.

Can you look up a NAICS code directly by DUNS number?

No. There is no federal lookup that maps a DUNS number straight to a NAICS code, because the federal government stopped using DUNS numbers on April 4, 2022. The General Services Administration replaced the DUNS number with the UEI (Unique Entity Identifier) as part of every SAM.gov registration.

That means the old workflow of typing a DUNS number into a lookup tool and reading off NAICS codes no longer applies to federal contracting. A company's NAICS codes live on its SAM.gov entity registration, keyed to the UEI instead.

If you have a DUNS number from an old record or a state filing, your path is: find the company's UEI, then pull its registration. Our free NAICS code lookup walks through that search step by step.

What replaced the DUNS number and how does that change your lookup?

In April 2022, the federal government stopped using DUNS numbers and switched to the Unique Entity Identifier (UEI), a 12-character alphanumeric code generated inside SAM.gov. Any article or tool telling you to "look up a NAICS code by DUNS number" is describing a pre-2022 process. The lookup still works, but the starting key is now the UEI, not the DUNS. If you need a refresher on what the codes themselves mean, start with what a NAICS code is.

What is a UEI and where do you find yours?

Your UEI is assigned automatically when you register or renew in SAM.gov, and it appears on the first page of your entity registration alongside your CAGE code. Log in to SAM.gov and open your registration to see it. If your entity is not yet registered, you have no UEI yet, and the SAM.gov entity search (covered in the next section) is the lookup path that matters.

Does your old DUNS number still work anywhere?

For federal purposes, no. SAM.gov searches, solicitations, and award records all key off the UEI. Some state registrations, Dun & Bradstreet's own credit products, and older contracts or proposal files still reference DUNS numbers, so keep your old number on file for reference. But when you are checking which NAICS codes a competitor or teammate is registered under, the UEI is the identifier that gets you there.

How do you find a company's NAICS code in SAM.gov using its UEI?

SAM.gov is free, requires no login to search, and shows the NAICS codes exactly as they appear on an active registration. Here is the path.

Step 1: Search the Entity Search

Go to SAM.gov and select "Entity" from the search dropdown, then choose "Entity Search." Enter the company's UEI or legal business name. If you only have the old DUNS number, you cannot search with it; federal systems stopped accepting DUNS in April 2022. Filtering by "Registration Status: Active" weeds out expired registrations.

Step 2: Open the registration detail page

Click the entity name in the results to open its registration detail page. Confirm the UEI and CAGE code match the company you intended, since name collisions happen with common firm names.

Step 3: Read the primary and secondary NAICS codes

Scroll to the "General" section of the registration. The primary NAICS code appears first, followed by any secondary codes the company added. A solo SDVOSB bidding on, say, DHS opportunities should check that the primary code matches the solicitation's NAICS, because set-aside eligibility is judged against the code the agency assigns, not the one you prefer. If the list looks stale, the owner can update codes during renewal or a voluntary update.

Tip: Copy the UEI straight from the SAM.gov page instead of retyping it. One swapped character sends you to a different company, and you will not always notice.

Which free third-party tools map DUNS or UEI to NAICS codes?

Once you have a UEI, several third-party platforms surface the NAICS codes tied to a company's registration, plus buying history and contacts. Here is how the main options compare for a solo owner-operator:

ToolCost tierWhat you get on a company profileWhere it falls short
GovTribeFree tier availableNAICS, agency activity, award historyFree tier limits saved searches
HigherGovPaid, with limited free viewsNAICS, set-aside usage, past awardsFull data behind a paywall
GovWin IQPaid subscriptionDeep pursuit and incumbent dataPriced for teams, not solo firms
GovSpendPaid subscriptionSpending records tied to NAICSLess focus on small-business certs
GovEagleAdjacent toolOpportunity alertsNot a full entity-profile lookup

Start with SAM.gov, which is free and authoritative. Use these tools when you want award history or competitor NAICS data alongside the code itself. GovScout Pro's Beginner tier ($29/mo, see pricing) sits downstream of the lookup: once you know your NAICS codes, it scores opportunities against your profile and returns GO, TEAM, or PASS. If a TEAM call makes sense, read our guide to teaming agreement basics before you commit.

Why do SAM.gov and state registration NAICS codes sometimes differ?

The same company can carry different NAICS codes in SAM.gov versus its state registration because the two systems ask different questions. NAICS codes classify business establishments by their primary activity, and "primary" depends on who is answering: you picked codes for your SAM.gov registration based on what you intend to sell to the government, while your state filing reflects what you reported when you incorporated, sometimes years ago.

Neither list is wrong. Your SAM.gov codes should emphasize the work you want to bid on, since agencies search by NAICS when posting solicitations and set-asides. If a state code no longer matches what you actually do, update it at renewal, but treat SAM.gov as the list that matters for federal bidding. Our 8(a) certification guidance covers keeping codes aligned with eligibility.

How do you verify a NAICS code is correct for a company's primary business?

A code is correct when it matches what the business actually does and sells, not what sounds more impressive. The Census Bureau publishes the full NAICS manual with definitions for every six-digit code, and each definition lists the activities included and excluded. Read the definition for your candidate code and confirm your main revenue-producing activity appears in the "includes" list.

Check size standards against your revenue

Every NAICS code carries a size standard, set by SBA, expressed as average annual revenue or employee count. If your three-year average revenue exceeds the standard for the code you picked, you will not qualify for set-asides tied to it, so the code choice has real consequences for which work you can pursue. A code with a $2.5 million size standard is a poor fit for a firm billing $4 million a year, even if the activity description matches, because the agency will classify you as other than small. If two codes both fit your activity, pick the one whose size standard your revenue actually clears, and keep your SAM.gov registration updated when your primary line of work shifts. Size standards are also the reason vetting a prime's codes matters, since the same revenue can make you small in one code and large in another.

When do you need a NAICS lookup for government contracting?

Three situations come up repeatedly in early-stage federal pursuit, and each starts with identifying a company's NAICS codes.

Vetting a prime before a teaming agreement

Before signing a teaming agreement, check the prime's NAICS codes and size status. If the work is set aside for your certification (8(a), SDVOSB, WOSB, or HUBZone) and the prime is a large business in that NAICS, the arrangement may not qualify as subcontracting toward your past performance. Confirming the NAICS also tells you which SBA size standard applies, since revenue or employee limits vary by code.

Responding to a sources sought notice

A sources sought response asks for your NAICS codes, UEI, and capability statement. Pulling the exact codes from your own SAM.gov registration keeps your response consistent with what contracting officers see in the system, and matching the right code to the requirement improves your odds of being flagged for the follow-on set-aside. The sources sought response builder can help you put it together.

Common mistakes when looking up NAICS codes by DUNS or UEI

Three errors trip up most first-time federal contractors.

First, expired registrations. SAM.gov hides full entity details, including NAICS codes, when a registration lapses, so searchers assume the company has no codes. Renew the registration, then search again.

Second, typo'd UEIs. One swapped character returns a different company or no results at all. Copy the UEI directly from your SAM.gov registration rather than retyping it, and confirm the legal name matches before trusting the data.

Third, confusing PSC codes with NAICS. Product and Service Codes appear on solicitations and describe what the government is buying; NAICS codes describe what your company does. They use different formats and never substitute for each other. Check both when sizing an opportunity.

Next step: Look up your own codes with the NAICS code lookup, then browse the construction, DoD and AI contracts guides to see which buyers use them. Compare plans on the pricing page.

Frequently Asked Questions

Is a DUNS number still required for federal contracting in 2026?

No. The federal government stopped accepting DUNS numbers in April 2022 and replaced them with the UEI, a 12-character alphanumeric code generated in SAM.gov. Every registration, solicitation, and award record now keys off the UEI. Keep your old DUNS on file for state filings or D&B credit products, but it plays no role in federal systems.

Can I look up another company's UEI for free?

Yes. SAM.gov's Entity Search requires no login and costs nothing. Enter the company's legal business name, filter by "Registration Status: Active," and open the registration detail page to see its UEI, CAGE code, and NAICS codes. Note that expired registrations hide full details, so a lapsed registration may show you less than you expect.

How many NAICS codes can I list in SAM.gov?

You list one primary NAICS code plus secondary codes on your SAM.gov registration. The primary code should reflect the work you most want to bid on, since agencies search by NAICS when posting solicitations and set-asides. You can add or update secondary codes during renewal or through a voluntary update whenever your business lines shift.

What is the difference between a NAICS code and a PSC code?

NAICS codes describe what your company does, using a six-digit format; PSCs (Product and Service Codes) describe what the government is buying and appear on solicitations. They use different formats and never substitute for each other. When sizing an opportunity, check both: the PSC tells you the commodity, the NAICS tells you who qualifies.

Does my D&B iUpdate NAICS selection still matter after the UEI transition?

For federal bidding, no. Agencies see the NAICS codes on your SAM.gov registration, keyed to your UEI, so that list governs set-aside eligibility and size standards. Your D&B record still matters for credit products and some state registrations, but if the codes differ, treat SAM.gov as the list that counts for contracting.