Non-conforming structure vs. code violation: what's the difference

A permit tech pulls up to a parcel and sees a garage that's clearly too close to the side line. Is that a violation, or is it grandfathered? The building on the ground doesn't answer that question. The file does.
What makes something legally nonconforming
A legal nonconforming use (also called a grandfathered structure in zoning talk) is a building or use that was lawful when it was built, but the zoning code changed underneath it. The setback got wider, the height cap got lower, the lot coverage limit got stricter, and the structure didn't move. It just sat there while the rules moved around it.
That's a protected condition, usually carried forward from the original permit or a certificate of occupancy issued before the code amendment took effect. Most jurisdictions let it stand as-is, with a catch: the protection often doesn't survive a teardown, a substantial expansion, or a gap in use past whatever the local code sets as the abandonment period. Add a second story to a grandfathered footprint and you may lose the nonconforming status on the whole structure, not just the addition.
A code violation is different. It's a structure, or a part of one, that was never permitted the way it sits, or that has drifted past what its permit allowed. Somebody built the deck four feet into the setback nobody granted a variance for. Somebody added a floor without touching the permit office. Somebody's commercial addition eats into the rear yard the approved plans never showed. There's no grandfathering here because there was never a lawful starting point for the condition you're looking at.
Why the file, not the footprint, decides it
The eye test fails both ways. A structure that looks wrong on the lot line might be sitting exactly where an old approval put it, decades before anyone widened the setback requirement. And a structure that looks fine from the street might have added a room, a floor, or a shed footprint that the original permit never covered. You can't settle either case by standing in the yard.
What settles it is matching the structure as it exists today against two things: the permit record for that parcel, and the zoning ordinance in effect at the time the structure (or the relevant addition) went up. If the footprint, height, and setbacks match what was approved and the code hasn't changed since, it's conforming, full stop. If they match the approval but the code has since changed around it, it's legal nonconforming. If they don't match the approval at all, and there's no variance or amended permit on file to explain the gap, it's a violation regardless of when the structure was built.
This is also where a lot of enforcement time gets lost. Pulling the original approval, checking whether an addition was permitted separately, and confirming the current zoning overlay for that lot is paper work, and it often only starts after a neighbor calls in a complaint. By the time someone walks the site, the gap between what's built and what's permitted may have existed for years.
A scheduled compliance pass, checking footprint, height, and setback against the permit record on a regular cycle rather than waiting for a complaint, catches that gap closer to when it opened. Permit Compliance runs that comparison using VHR imagery and a 3D model on a quarterly basis, flagging each permit as matching, exceeding, or diverging from what was approved, so a case file starts with the discrepancy already documented instead of a neighbor's phone call.
The practical distinction for case prep
When you're building a case file, the question isn't "does this look out of place." It's "what was approved, and does the structure today match it." If it matches an old approval, note the nonconforming status and move on. If it doesn't match any approval on record, that's your violation, and the file needs the gap documented: what the permit shows, what's on the ground, and the delta between them.
Keep that distinction straight in the file and the rest of the enforcement process, from notice to hearing, rests on solid ground. If you're tired of that gap only surfacing after a complaint, it's worth running a quarterly audit against the permit file instead.