There are two classes of renters in San Francisco: those who are protected by the Rent Ordinance of 1979, and those who are not. Most renters in buildings predating June 1979 enjoy safeguards from enormous rent hikes and baseless evictions.

With the help of our friends at the San Francisco Tenants Union, we identified six rights you may not even know you have. Several of the following tips below apply only to apartments that are covered by the Rent Ordinance and, oddly enough, even to illegal units. In a bizarre twist of red tape, you can sometimes be better protected living in an illegal unit than in a market-rate one built after 1979.

Before we launch into the legal stuff, let's get a few things out of the way: The magic number in the rental ordinance is June 13, 1979. If your building was issued a certificate of occupancy before this date, congratulations, you're protected by the ordinance (with a few minute exceptions).

If the paperwork was issued after June 13, 1979, our condolences. You don't have rent control, and you can be evicted for almost any reason—because the building's on the market, because it's Tuesday, because the landlord had a really disappointing burrito. It doesn’t mean you will—San Francisco has an abundance of laws to help protect renters—it only means it’s easier for a landlord to file eviction. And your friends with Rent Ordinance protection, however, can be evicted only for just cause, which is limited to these 16 scenarios.

And now, without further ado, the dirt you came here for:

1. If your unit is illegal—if your landlord created it without permits—tenant law can still apply. In most cases, you're protected by the Rent Ordinance, even if the unit was created after 1979. That's because illegal units by definition lack a certificate of occupancy. Without a certificate of occupancy, landlords have no way to claim that the unit was created after 1979 and is thus exempt from the Rent Ordinance. You also enjoy eviction protections as any renter covered by the Rent Ordinance would.

2. Even while your landlord is hanging on to your deposit, it's still technically yours, which means you have a right to the interest it accrues during your tenancy. If you've lived in your apartment for at least a year (and as long as you don't live in subsidized housing), you're entitled to that interest when you move out. It says so right there in the San Francisco Administrative Code, section 49.2. This goes for everyone, not just the elect who enjoy Rent Ordinance protection.

3. If your apartment has a great view that was advertised as part of the total package—e.g., views of the Golden Gate, the water, the skyline—that's a perk that adds big bucks to the rent. If new construction comes along and blocks the promised view, you can apply to have your rent reduced. You'll need to file a decrease in services petition with the Rent Board. (Sorry, market-rate tenants, this strategy won't work for you since your landlord can jack up the rent for almost any reason.)

4. Say you get evicted for just cause—meaning your unit falls under the 1979 rental ordinance—because, for instance, the owner is moving in or plans to take the unit out of service. The owner is usually required to pay out around $5,200 for each tenant. This amount can go higher, in some cases breaking the six-figure mark. (This varies depending on the eviction cause and increases each March.) Same goes for illegal units, too.

Note, however, that an owner move-in is a different scenario from the Ellis Act. The Rent Board has more info about Ellis Act relocation payments.

5. Under the Rent Ordinance, if the owners evict you so they can move into the unit, they're supposed to move in within three months and live there for at least three years following your eviction date. If they move out before the three years are up, they're required to offer the apartment back to you at your old rental rate (plus allowable increases under the Rent Ordinance).

If you are evicted under Ellis Act, you have the same protection, but for a ten-year period—though the original rent only has to be offered for five years. If your unit was sold to new homeowners, those people are also bound by the Ellis Act. If they relocate within the ten-year period and decide to rent out their home, they're required to offer it to you first. The bad news is that you (or your good samaritan former neighbors) pretty much have to do your own detective work. The owners are supposed to notify the Rent Board of their intent to re-rent, but somehow that step tends to get skipped.

6. If you have to move out because of a fire, a flood, or another natural catastrophe, you can move back into your unit once it's been repaired at the same rent you paid before the improvements, plus any increases allowed by the rent board, such as the standard annual rent increase. (Sorry, market-raters, you're out of luck here as well.)

7. Those of you under Rent Ordinance protection, these are the only scenarios for which you can be evicted.

Want to learn more? The Tenants Union is a great place to start, and (with some patient digging and tolerance for aggressively nested lists) you can find chapter-and-verse citations of the Rent Ordinance on the Rent Board site.