Don’t want to end up sitting in jail tonight? There’s an app for that. Seriously.

The best way to win a DWI charge is never to be in a position to drink and drive in the first place. However, this may not be avoidable at all in a social setting, so the next best thing is to be powerfully well-informed. These free apps for your smartphone aren’t about ‘getting away’ with drunk driving, but for preventing unnecessary legal complications from DWI charges.

They might save your life.

The B4UDrink Virtual Bar

Recommended by Responsibility.Org, this a very informative online app that can tell you all you need to know about how alcohol affects you depending on your body type, age, and gender; and how many drinks it will take to get you tipsy. You can select from a variety of standard drinks, your drinking pace, and food consumption.

It shows the impact of these variables on your behavior and gives an estimate of how long before your BAC level normalizes.

The Oh Crap! App

The DWI lawyer’s best friend is a free app that educates the public on their legal rights when being stopped and investigated for a criminal offence (including drunk driving). Apart from the “Educate Me” function, there’s also the “Prevention” function that allows users to calculate their possible blood alcohol level and gives a quick link to contact nearby taxi services based on the user’s GPS location.

It also features an Oh Crap! button that for emergencies that gives a quick “Call Lawyer” button to the nearest partner attorney in the user’s geographical location. It also activates a recording function while the user interacts with law enforcement and automatically uploaded to the Oh Crap App’s cloud storage for later use in court proceedings.

DUI Checkpoint Finder

Also known as the “DUI Dodger” app, this app allows you to locate and add notes about checkpoints within a 50-mile area. Despite the name, its intent is to warn drivers against getting behind the wheel and provides information about DUI myths, penalties, and likelihood of getting caught.

The app also features a personal Sobriety Test to grade yourself if you’re really as capable of safe driving as you feel after a few drinks. If your fail this simple test, you’d be better off just calling a cab and avoiding thousands in legal fees and months of losing your license, and jail time.

It is also very useful for sober drivers to want to avoid being trapped in a line behind a sobriety checkpoint.

The Breathometer App

This app requires a plug-in breath meter device ($49.99) that can instantly give you a good estimate on your BAC and how much time remaining before returning to normal levels. It plugs into your smartphone’s headphone jack to turn it into a shareable breathalyzer.

The Breeze wireless breathalyzer ($99) is a more compact next-generation sensor and can also serve as a key ring to ensure you’re always keeping it with you.

Anyone who hosts a party will find these a boon for avoiding being held liable for letting others drink and drive. It is also a tool to comfort parents of their worries, because the app also give quick access to Uber and other designated driver services, a listing of nearby restaurants and hotels to wait out intoxication.

In the end, the best advice is to not even think about drinking and driving. Get more information about legal complications from DWI charges.