Python 3 brine and cure calculator

  • Some of the links on this forum allow SMF, at no cost to you, to earn a small commission when you click through and make a purchase. Let me know if you have any questions about this.
SMF is reader-supported. When you buy through links on our site, we may earn an affiliate commission.

JC in GB

Master of the Pit
Original poster
OTBS Member
★ Lifetime Premier ★
Sep 28, 2018
3,725
3,077
Green Bay, WI
To my fellow smoking friends. Here is a program I made in Python3 to calculate brine and nitrate cure strength. All calculations were obtained from the USDA Processing Inspectors' Calculations Handbook (1995).

Python3 is an open source programing language that can be installed on most computer platforms.

Any feedback is appreciated. :)

Here is the source code if anyone wishes to give it a whirl.

#############################################################################

#Python PPM cure calculator#
#This program will calculate PPM of Sodium nitrate in meat curing brine #
#All weights are in metric units #

# 03 APR 2019 #

#############################################################################


### Variables ###


#_H2Oltr amount of water in liters

#_curegm weight of cure #1 in gm

#_NaNO3 weight of Sodium nitrate (Cure weight * 0.0625)

#_ppm PPM calculated

#_ppmtar PPM target

#_brinepc brine concentration percent

#_brinekg weight of pickle

#_pickup meat pick up %

#_NaCl weight of salt needed for brine solution


### END VARIABLES ###


print ('PPM calculator for brine curing meat using cure #1 powder 6.25% NaNO3.')

print ()

print ()

_ppmtar = input ('What is your target PPM for this cure?')

_ppmtar = float (_ppmtar)

print ()

_H2Oltr = input ('Amount of water in liters?')

_H2Oltr = float (_H2Oltr)

print ()

_brinepc = input ('What is your brine concentration target in % salinity? (Decimal value)')

_brinepc = float (_brinepc)

print()

_NaCl = ((_H2Oltr)* _brinepc)/ abs(_brinepc -1)

_brinekg = _H2Oltr + _NaCl

_pickup = input ('What is the pickup %')

_pickup = float (_pickup)

print ()

_NaNO3 = (_ppmtar * _H2Oltr)

_NaNO3 = float(_NaNO3)

_curegm = (_NaNO3 * 16)/1000

_curegm = float (_curegm)

print ()

print ('You will need {:10.3f}'.format (_NaCl * 1000),'grams of salt for ',_H2Oltr,' liters of water.')

print ()

print ('Brine weight is: {:10.3f}'.format (_brinekg),'kg')

print ()

print ((_NaNO3),'mg NaNO3 needed for ',_ppmtar,' PPM nitrate.')

print ()

print ((_curegm),'grams of cure #1 needed for ',_ppmtar,' PPM nitrate.')

print ()

print ((_curegm * _pickup),'grams of cure #1 needed for ',_ppmtar,' PPM nitrate in a ',_pickup,'% pick up brine.')

print ()

print ('You will need{:10.3f}'.format ((_NaCl *1000) - (_curegm * _pickup)),'grams salt for a {:10.3f}'.format(_brinepc * 100),'% strength brine using ',(_curegm * _pickup),' grams of cure #1.')
 
Cool stuff guys, when I get a chance I'll pop it into the online compiler and give it a whirl! :emoji_laughing:
 
  • Like
Reactions: JC in GB
That’s pretty cool!

A few questions/comments:
1 - Cure #1 is Sodium Nitrite (NaNO2) not Sodium Nitrate (NaNO3).
2 - Your calculator is using UADA method 1 (%pickup), not Method 2(equilibrium). Maybe worth noting that, or give the option to use one or the other. I’m still conducting experiments at home, but I’ve convinced myself that Method 1 is the better of the two.
3- May also note that your calculator can be used for injecting. i.e., if injecting, then %pickup = % injected.
4 – I usually see salinity given with units g/kg, or g/L. How does that compare to the % salinity you are using? My brine calculations are done in terms of °SAL (at 100°SAL no more salt will dissolve in the water, ~350g/L water). If you want to input a g/L conversion to °SAL, the equation is
Salinity [g/L] = 0.011*°SAL^2 + 2.5*°SAL
or going the other direction
°SAL = -0.00025*Salinity [g/L]^2 + 0.3661*Salinity [g/L]
I determined those equations by curve fitting to salinity table.
 
Polish Deli,

Thanks for you feedback. Please see my responses in bold below.

Awesome feedback. Much appreciated.


That’s pretty cool!

A few questions/comments:
1 - Cure #1 is Sodium Nitrite (NaNO2) not Sodium Nitrate (NaNO3).

Thanks for that catch. I will change the name and variables. Not sure why I got that mixed up. Guess I was too focused on the math. Rookie mistake... ;)


2 - Your calculator is using UADA method 1 (%pickup), not Method 2(equilibrium). Maybe worth noting that, or give the option to use one or the other. I’m still conducting experiments at home, but I’ve convinced myself that Method 1 is the better of the two.

You are correct, I am using the USDA method 1 for calculating pick-up. Most users on this forum including myself use whole meat cuts so method 1 makes the most sense.

I could also set it up to output method 2 calculations as well. That would be fairly easy to implement.


3- May also note that your calculator can be used for injecting. i.e., if injecting, then %pickup = % injected.

Very good, I hadn't thought about that but that would work as well. I like it. I am sure to try this as well. Wouldn't I need the meat weight to calculate method 2?

4 – I usually see salinity given with units g/kg, or g/L. How does that compare to the % salinity you are using? My brine calculations are done in terms of °SAL (at 100°SAL no more salt will dissolve in the water, ~350g/L water). If you want to input a g/L conversion to °SAL, the equation is
Salinity [g/L] = 0.011*°SAL^2 + 2.5*°SAL
or going the other direction
°SAL = -0.00025*Salinity [g/L]^2 + 0.3661*Salinity [g/L]
I determined those equations by curve fitting to salinity table.

I used Pop's full strength brine as my starting point in salinity calculations.
Pop's brine comes out around 27 degrees Sal or 7% salinity. The calculator will give you the amount of salt needed for an x% brine. I have massaged to equation to convert salinity % to NaCl per weight of H2O. I wanted to make that as simple as possible. You are correct though, it does not calculate Sal degree values. I see you provided the Sal equations... Thanks for that. Will see about including that as well. Great information.

Lastly, thanks for your feedback, it is much appreciated and will only help to make this calculation utility better.

I hope this will help some of my fellow smokers get their brines up and running faster than by gum and by gosh number crunching. That is why I wrote it in the first place. I was sick of recalculating for every new cut of meat I was trying to brine.
 
Last edited:
For calculating the % injection, you’d need the meat weight. I usually inject 10%.
Going by UDSA guidelines, if you are injecting, then only Method 1 applies.
Mathematically though, if you want to use Method 2, you are free to inject as much or as little as you want, since the amount injected doesn’t change the total (brine+meat) weight. In any case, I also prefer to use Method 1.

Oh, I understand your salt calculation now. It’s solving % salt = Xg salt / (Xg salt + Yg water).

Since that’s the case, converting to °SAL is easy, since it’s a unit that is normalized to 100 at 26.4% with a 0 intercept.
% Salt (Decimal value) = 0.00264* °SAL

Really nice work on the calculator! I hope people use it and appreciate the effort you put into it.
 
  • Like
Reactions: JC in GB
JC, morning... I can't run that program...
Would you mind running a test sample and displaying the results for me....
Say a 10# beef roast...

Dave
 
  • Like
Reactions: JC in GB
JC, morning... I can't run that program...
Would you mind running a test sample and displaying the results for me....
Say a 10# beef roast...

Dave
Certainly. I will have to run it Monday if you can wait that long. I am running it on a raspberry pi and it is at another location at the moment.
 
You would need to load a python 3 compiler on your computer for it to work. I will see if I can make an executable version for Windows.
 
I was wondering how you converted commercial curing to home curing, and if the results were the same as home curing...
 
I thought the pickup method was discredited here for home use.

For the mathematically challenged fellow smokers here is a a cure calculator by one of our members:
http://diggingdogfarm.com/page2.html
No need to install compilers on your computer.

Pops also authored a well known wet cure. Look it up. And spare a "get well" thought for Pops while you do that.
My thoughts with you Pops. Looking forward to your return here.
 
  • Like
Reactions: JC in GB
The "pick up" term is a misnomer... It refers to, the amount of brine/cure pick up by the needle injection machine... Meat is weighed before and after injection to see what it picked up.. Then the needle injector is adjusted to insure the proper amount of brine/cure is inside the meat... Adjusted by the pressure in the needles, speed of the needles travel during the injection etc.... Many folks have assumed "% pick up" is uniform across all cuts of meat making the "USDA Processing Inspectors' Calculations Handbook" a useful tool for home meat processing... Ain't so...
Anywho, I have concerns when folks use the handbook... Some things used in industry cannot be easily transferred for home use...
I personally saw the discrepancy, when belly bacon was being made, at the processor I worked at as an outside contractor... A batch of bellies that came in, 2200#'s worth, did not meet specifications... It was due to the needle machine operator not adjusting the machine due to the belly thickness changing by 1/4"....
Some meats go in a vacuum tumbler after injection... Commercial processing is a totally different animal from home processing...
 
  • Like
Reactions: JC in GB
Great information and comments. I truly appreciate input from experts in the field. It can only make my ascension to a pitmaster faster and less painful. I am not trying to question or disprove anyone else's work on this forum, I am simply on the path to learning the secrets and science behind great BBQ and with the advice and support of the great BBQ chefs on this forum, I find it within my grasp.

Also, I hope Pops is doing well and making a speedy recovery.
 
JC, morning... I can't run that program...
Would you mind running a test sample and displaying the results for me....
Say a 10# beef roast...

Dave


Here are the numbers I got for a 10 lb beef roast. Here are the constants I used.

This calculation is for an injection brine.

Meat weight 10 lb
Brine weight 1 lb
PPM of cure: 156
Salinity of injection brine 5%

Calculated values:

Salt: 12.55 grams
Cure#1: 11.32 grams
Water: 0.453 liters
 
That's correct for your injection of 5%, for the cure#1...
Salt is only 0.27% which is terribly low... a total of about 0.52% salt....
I prefer a total of ~2% salt... ~1.75% Kosher salt injection.... which would be ~ 87 grams of Kosher salt added to the brine injection...
 
  • Like
Reactions: JC in GB
That's correct for your injection of 5%, for the cure#1...
Salt is only 0.27% which is terribly low... a total of about 0.52% salt....
I prefer a total of ~2% salt... ~1.75% Kosher salt injection.... which would be ~ 87 grams of Kosher salt added to the brine injection...

I agree the salt level I chose is pretty low. I didn't want the end product too salty. I am still a bit shaky on just how salty the end product should be. I have heard that a 0.5% concentration is palatable to most people. I am now always concerned about too much salt as a side effect of aging. ;)

Thanks for your reply. I learn new things on the forum every day. Simply amazing...
 
I was wondering how you converted commercial curing to home curing, and if the results were the same as home curing...

Dave,
Can you help me understand what you mean by this, and recommend proper strategies?
For home curing, I think we are naturally forced to modify our processes simply due to the equipment we have available to us. For example, we use syringes for injecting cure because we don’t have pump stations at home. But whether curing at home or on an industrial scale, the same nitrite levels should be targeted. To that extent, JC’s calculator works as intended.
 
  • Like
Reactions: JC in GB
SmokingMeatForums.com is reader supported and as an Amazon Associate, we may earn commissions from qualifying purchases.

Latest posts

Hot Threads

Clicky