Nucleic Acid Calculator
Paste any DNA or RNA sequence to get its nucleic acid structure in numbers: monomers, molecular weight, chemical formula and elements, GC content, extinction coefficient, concentration from A260, melting temperature and bonds. With labeled nucleic acid diagrams and a plain-English guide to what nucleic acids are, what they do and what they are made of.
⚡ 0. Quick Answer
A nucleic acid is a polymer of nucleotides that stores and uses genetic information. The two types are DNA and RNA. Each monomer, a nucleotide, has a phosphate, a five-carbon sugar and a nitrogenous base.
Nucleotides join by phosphodiester bonds into a sugar-phosphate backbone with the bases sticking out. DNA is usually a double helix held together by A–T and G–C base pairs; RNA is usually single-stranded and uses U instead of T. Nucleic acids contain five elements: carbon, hydrogen, oxygen, nitrogen and phosphorus, and no sulfur.
Rule of thumb: one DNA nucleotide weighs about 309 g/mol (618 g/mol per base pair; about 321 g/mol per RNA nucleotide), and 1 A260 unit is about 50 ng/µL of dsDNA, 40 of RNA and 33 of ssDNA.
Key takeaways
- The monomer of a nucleic acid is the nucleotide; the polymer is a polynucleotide such as DNA or RNA.
- The two types of nucleic acids are DNA (deoxyribonucleic acid) and RNA (ribonucleic acid).
- Nucleic acids are made of C, H, O, N and P; they have no sulfur, which is how Hershey and Chase told DNA from protein.
- The main function of nucleic acids is to store, copy and express genetic information; RNA also builds proteins and catalyses reactions.
- The worked primer ACGTGCTAGCTAGGCATCAG is 20 nt, 6,142.04 g/mol, C₁₉₅H₂₄₅N₇₈O₁₁₇P₁₉, and A260 0.25 at 1 in 10 means 70.50 ng/µL (11.48 µM).
📚 1. What Is a Nucleic Acid?
Nucleic acid definition (biology): a nucleic acid is a large biological molecule, a polymer made of nucleotide monomers, that carries the genetic information of a cell or virus. The name comes from where they were first found: in 1869 Friedrich Miescher isolated a phosphorus-rich acid from cell nuclei and called it nuclein (Dahm, 2005). In simple terms, nucleic acids are the molecules that hold the instructions for life and help carry them out.
What is in a nucleic acid? The building blocks
Every nucleic acid is built from nucleotides, and every nucleotide has three parts:
- A phosphate group (PO₄), which gives nucleic acids their negative charge and their acidity.
- A five-carbon sugar (a pentose): deoxyribose in DNA and ribose in RNA. Ribose has an OH group on carbon 2′; deoxyribose has only an H there.
- A nitrogenous base: adenine (A), guanine (G), cytosine (C), and thymine (T) in DNA or uracil (U) in RNA.
Nucleic acid monomer and polymer
Nucleic acids are polymers of nucleotides. During polymerisation, the 3′-OH of one nucleotide reacts with the 5′-phosphate of the next, releasing water (and, in the cell, pyrophosphate from a nucleoside triphosphate). The link is a phosphodiester bond. Repeating this builds a chain with a free 5′-phosphate at one end and a free 3′-OH at the other, so every nucleic acid has a direction. A chain of n nucleotides has n − 1 phosphodiester bonds; a closed circle, such as a plasmid, has n.
What are the two types of nucleic acids?
The two types of nucleic acids are DNA and RNA. So yes, DNA is a nucleic acid and RNA is a nucleic acid. They differ in three ways: the sugar (deoxyribose vs ribose), one base (thymine vs uracil) and usually the shape (double helix vs single strand).
| Feature | DNA | RNA |
|---|---|---|
| Full name | Deoxyribonucleic acid | Ribonucleic acid |
| Sugar | Deoxyribose (no OH on C2′) | Ribose (OH on C2′) |
| Bases | A, T, G, C | A, U, G, C |
| Usual shape | Double helix, two antiparallel strands | Single strand that folds on itself |
| Base pairs | A–T (2 H-bonds), G–C (3 H-bonds) | A–U, G–C, plus G–U wobble |
| Main job | Long-term storage of genetic information | Uses the information: mRNA, tRNA, rRNA, regulation |
| Where (eukaryotes) | Nucleus, mitochondria, chloroplasts | Made in the nucleus, works mostly in the cytoplasm |
| Stability | Very stable | Less stable: the 2′-OH helps cut the backbone |
| Average mass per nucleotide | about 309 g/mol (618 per bp) | about 321 g/mol |
What is the function of nucleic acids?
The main function of nucleic acids is to store and transmit genetic information and use it to make proteins. In more detail, the functions of nucleic acids are:
- Storing genetic information. DNA holds the instructions for every protein and RNA a cell can make.
- Passing it on. DNA is copied before cell division and passed to offspring, which is the basis of heredity.
- Carrying the message. Messenger RNA copies a gene and carries it to the ribosome.
- Building proteins. Transfer RNA brings amino acids and ribosomal RNA joins them; see the protein synthesis steps.
- Catalysis. Some RNAs are enzymes (ribozymes), including the peptide-bond-forming centre of the ribosome (Cech, 2000).
- Regulating genes. microRNAs and siRNAs switch genes down (Fire et al., 1998).
Two functions of nucleic acids that cover the rest: storing information (DNA) and expressing it (RNA).
How are proteins and nucleic acids related?
Nucleic acids encode proteins, and proteins make nucleic acids. The DNA sequence of a gene sets the order of amino acids in a protein, three bases per amino acid. In turn, proteins such as DNA polymerase and RNA polymerase copy and read nucleic acids, and histone proteins package DNA. Each needs the other.
A worked one-liner: the 20-base single-stranded DNA primer ACGTGCTAGCTAGGCATCAG has 5 A, 5 C, 6 G and 4 T (55% GC), the formula C₁₉₅H₂₄₅N₇₈O₁₁₇P₁₉, a molecular weight of 6,142.04 g/mol and 19 phosphodiester bonds.
Who uses this: students learning nucleic acid structure, function and monomers; lab scientists working out primer and DNA concentrations from a NanoDrop reading; molecular biologists checking the mass and melting temperature of an oligo before PCR; and teachers who need a labeled nucleic acid picture and worked numbers.
🧮 2. Set Up Your Data
No sequence, only a composition? Type how many of each base the molecule has. Mass, formula, GC%, extinction coefficient, concentration and Tm depend only on the counts.
The molecule
The A260 reading (concentration)
📊 3. Results
🧠 4. Interpretation of Results, In Detail
4.1 Length and the monomer count
Length is the number of monomers (nucleotides) in one strand, written nt for single strands and bp (base pairs) for double strands. A primer is 18 to 25 nt, a PCR product a few hundred bp, a plasmid a few thousand bp, and a human genome about 3.1 billion bp per set of chromosomes (International Human Genome Sequencing Consortium, 2001).
4.2 Molecular weight
The molecular weight is the sum of the nucleotide residues plus the atoms at the ends. A synthetic oligo usually has a 5′-OH, so it has one phosphate fewer than nucleotides; DNA from PCR or a cell usually has a 5′-phosphate. The value is for the free acid; the sodium salt you buy weighs about 22 g/mol more per phosphate. Biopython's molecular_weight assumes a 5′-phosphate, so choose that option to match it.
4.3 What elements are found in nucleic acids?
Only five: carbon, hydrogen, oxygen, nitrogen and phosphorus (CHONP). Nitrogen comes from the bases, phosphorus only from the backbone, and carbon, hydrogen and oxygen from the sugar and bases. The element table always shows sulfur as 0: nucleic acids do not contain sulfur. That fact made the Hershey and Chase (1952) experiment work: they labelled phage protein with ³⁵S and phage DNA with ³²P, and only the ³²P entered the bacteria, showing that DNA is the genetic material.
4.4 GC content
GC content is the share of G and C bases. Each G–C pair has three hydrogen bonds and stacks more strongly than an A–T pair, so GC-rich DNA melts at a higher temperature. Primers work best between 40% and 60% GC. Whole genomes range from about 20% (Plasmodium) to over 70% (Streptomyces); human DNA averages about 41%. In double-stranded DNA, A = T and G = C (Chargaff, 1950).
4.5 The extinction coefficient
Bases absorb ultraviolet light most strongly at 260 nm, so A260 measures nucleic acid. The extinction coefficient (ε) here is the sum of each nucleotide's value. Real single strands absorb a little less because neighbouring bases stack (hypochromicity), so the nearest-neighbour method (Cavaluzzi and Borer, 2004; Tataurov et al., 2008) is more exact, by about 5 to 15% for short oligos.
4.6 Concentration in ng/µL, µM and copies
Concentration in ng/µL tells you how much to load; µM (the same number as pmol/µL) tells you how many molecules, which is what primers and probes need; copies per µL is used for qPCR standards. The verdict badge reads A260 IN RANGE between 0.1 and 1.0, the range where spectrophotometers are linear. Outside it the badge reads A260 TOO LOW or A260 TOO HIGH: dilute or concentrate and read again.
4.7 Melting temperature
Tm is the temperature at which half of a duplex has separated into single strands. The calculator picks the formula by length: the Wallace rule below 14 nt (Wallace et al., 1979), a GC formula for 14 to 49 nt, and a salt-adjusted formula for 50 nt and longer. For primers, set the annealing temperature about 3 to 5 °C below Tm. For critical work use nearest-neighbour Tm (SantaLucia, 1998) with your buffer's Mg²⁺.
4.8 Bonds in nucleic acids
Two kinds of bond hold a nucleic acid together. Covalent phosphodiester bonds join the sugar of one nucleotide to the phosphate of the next along each strand; hydrogen bonds hold the two strands together, two per A–T or A–U pair and three per G–C pair. A third link, the N-glycosidic bond, joins each base to its sugar. Base stacking between neighbouring bases adds more stability than the hydrogen bonds do.
4.9 Complement and reverse complement
The complementary strand pairs A with T (or U) and G with C and runs the other way. The reverse complement is that strand written 5′ to 3′, which is how you order a reverse primer or read the other strand of a sequencing result. The copy button above gives it ready to paste.
4.10 What this calculation cannot tell you
It cannot tell you purity: A260 counts every nucleic acid in the tube, including RNA in a DNA prep, free nucleotides and primer dimers. Check A260/A280 (about 1.8 for DNA, 2.0 for RNA) and A260/A230 (2.0 to 2.2), and run a gel to see the size and integrity. Modified bases, dyes and backbone changes are not included in the mass.
✍ 5. How to Report Your Nucleic Acid Results
📌 Key conventions for this style
- Name the instrument, the blank and the method (factor or extinction coefficient).
- State A260/A280 and A260/A230 purity ratios.
- Give oligo sequences 5′ to 3′ with any modifications.
- Say whether the mass is for the free acid or a salt.
📌 Key conventions for this style
- Put a primer table with sequence, length, GC%, Tm and product size.
- Name the Tm method; different tools differ by several degrees.
- Report the software and version.
- Show a gel image beside concentration data.
📌 Key conventions for this style
- Record the raw A260 and the dilution, not only the final number.
- Note the tube label and freezer position.
- Record the buffer (TE or water) used to dissolve it.
- Write the date of each freeze-thaw.
📌 Key conventions for this style
- Keep numbers to the ones your result depends on.
- Use kDa for long molecules, g/mol for oligos.
- Use the labeled nucleic acid diagram on the poster.
- Spell out DNA and RNA once for a general audience.
📌 Key conventions for this style
- List every oligo with its full sequence.
- Give the supplier and purification grade.
- Give the extinction coefficient used for concentration.
- Deposit new sequences in GenBank.
∑ 6. Formulas Used
🔀 7. Nucleic Acid Calculation Flow Chart
This flow chart follows the worked example, the 20-nt DNA primer ACGTGCTAGCTAGGCATCAG with a 5′-OH end, read at A260 0.25 after a 1 in 10 dilution. The Excel, R and Python sections use the same numbers.
Check any box yourself: the Excel sheet in Section 9, the R script in Section 10 and the Python script in Section 11 all return 6,142.04 g/mol, 70.50 ng/µL and 53.83 °C for this primer.
📝 8. How to Use This Nucleic Acid Calculator
- Paste your DNA or RNA sequence. Paste the sequence 5 prime to 3 prime into the box. FASTA headers, spaces, numbers and lowercase are cleaned automatically, and the live readout shows the length, type (DNA or RNA) and GC content.
- Or load a sample. Ten built-in samples cover a PCR primer, a PCR product, an siRNA, an mRNA with a poly-A tail, a plasmid, GC-rich and AT-rich DNA, a telomere repeat, an over-range reading and a failed read.
- Or upload a file, or type base counts. On the Upload tab choose a FASTA or TXT file, or a CSV or Excel file and the column that holds the sequence. On the Manual tab type how many of each base the molecule has.
- Choose the nucleic acid type. Pick single- or double-stranded DNA or RNA. Double strands add the complementary strand to the mass, extinction coefficient and bond counts.
- Choose the shape and 5 prime end. Pick linear or circular, and a 5 prime hydroxyl (most synthetic oligos) or 5 prime phosphate (PCR products and natural DNA). The end changes the mass by 79.98 g/mol.
- Enter the A260 reading. Type the absorbance at 260 nm, the dilution factor, the path length and, if you want the total yield, the volume. Leave the method on automatic unless you have a reason to change it.
- Set the salt. Enter the sodium concentration of your buffer in mM. It is used by the salt-adjusted melting temperature formula and the Tm chart.
- Press Calculate Nucleic Acid Properties. Nothing is calculated until you press the button. Changing any input clears the old results so you never read stale numbers.
- Read the results. Check the cards for length, molecular weight, formula, GC content, concentration and Tm, then the element table (with sulfur at zero), the base table, the sequence views and the four charts.
- Report and export. Copy one of the five ready-made report sentences, copy the reverse complement, or download the full report as a text document or PDF.
📈 9. How to Calculate Nucleic Acid Properties in Excel
Excel can count bases, add up the molecular weight and convert an A260 reading into a concentration with a handful of text and maths functions. Base counting uses the LEN minus SUBSTITUTE trick, the mass is a SUMPRODUCT of counts and residue masses, and concentration is one line of Beer-Lambert arithmetic. What trips people up is forgetting the end correction, mixing up ng/µL and µM, and lowercase letters that SUBSTITUTE does not see.
=B2*50*C2 gives ng/µL. For a primer, use the sequence-specific line in step 5: =B3/(B4*B5)*B6*B2*1000 on a second sheet, which returns 70.50 ng/µL for the worked example.9.1 The functions you need
| You want | Excel function | Note |
|---|---|---|
| Clean pasted text | =UPPER(SUBSTITUTE(A2," ","")) | Delete FASTA headers by hand first |
| Length | =LEN(B2) | Number of nucleotides |
| Count one base | =LEN($B$2)-LEN(SUBSTITUTE($B$2,D2,"")) | D2 holds A, C, G or T; fill down |
| GC content | =(E3+E4)/B3 | Format as a percentage |
| Molecular weight | =SUMPRODUCT(E2:E5,F2:F5)+18.015-79.979 | Drop the −79.979 for a 5′-phosphate |
| Extinction coefficient | =SUMPRODUCT(E2:E5,G2:G5) | G holds 15400, 7400, 11500, 8700 |
| dsDNA by factor | =A260*50*dilution | 40 for RNA, 33 for ssDNA |
| Concentration by ε | =A260/(eps*path)*dilution*MW*1000 | Gives ng/µL |
| Micromolar | =conc*1000/MW | Same number as pmol/µL |
| Tm (14 to 49 nt) | =64.9+41*(E3+E4-16.4)/B3 | Wallace below 14 nt: =2*(E2+E5)+4*(E3+E4) |
9.2 Step by step
1 Paste the sequence and measure it
Put the sequence in A2. In B2, clean it; in B3, count its length.
=UPPER(SUBSTITUTE(A2," ","")) =LEN(B2)B2 returns ACGTGCTAGCTAGGCATCAG and B3 returns 20.
2 Count the four monomers
Type A, C, G and T in D2 to D5. In E2, count how many times each one appears, then fill down.
=LEN($B$2)-LEN(SUBSTITUTE($B$2,D2,""))E2 to E5 give 5, 5, 6 and 4. Their sum is 20.
3 Add up the molecular weight
Put the residue masses in F2 to F5 (313.210, 289.184, 329.209, 304.195). Multiply by the counts, then add water and remove one phosphate for a 5′-OH oligo.
=SUMPRODUCT(E2:E5,F2:F5)+18.015-79.979The residues sum to 6,204.00; F7 shows 6,142.04 g/mol.
4 Add up the extinction coefficient
Put the nucleotide extinction values in G2 to G5 and multiply by the counts.
=SUMPRODUCT(E2:E5,G2:G5)G7 shows 217,800 M⁻¹cm⁻¹.
5 Convert A260 into concentration
On a second sheet, enter the MW, A260, ε, path length and dilution in B2 to B6. Beer-Lambert gives mol/L; multiplying by the MW and 1000 gives ng/µL.
=B3/(B4*B5)*B6*B2*1000 =B7*1000/B2B7 returns 70.50 ng/µL; B8 returns 11.48 µM.
6 Melting temperature and the reverse complement
On a Results sheet, use the GC formula for 14 to 49 nt, pointing at the counts on Sheet1. Excel 365 reverses text with SEQUENCE; lowercase placeholders stop SUBSTITUTE from swapping a base twice.
=64.9+41*(Sheet1!E3+Sheet1!E4-16.4)/Sheet1!B3 =UPPER(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(CONCAT(MID(Sheet1!B2,SEQUENCE(Sheet1!B3,,Sheet1!B3,-1),1)),"A","t"),"T","a"),"G","c"),"C","g"))B2 returns 53.83 °C; B3 returns the reverse complement CTGATGCCTAGCTAGCACGT.
9.3 The awkward cases
Double strands. Count the complementary strand too: its A count is your T count and so on. Add both strands' masses, or use the shortcut MW ≈ bp × 617.96 + 36.04 for a 5′-phosphate duplex. For concentration, use the factor of 50 rather than summed extinction coefficients, which ignore base stacking.
RNA. Use U instead of T, the RNA residue masses (329.209, 305.183, 345.208, 306.167) and 9,900 for U.
N bases. Count them with =LEN(B2)-SUM(E2:E5) and decide whether to ignore them or replace them with an average residue.
9.4 Why your Excel answer might differ from R, Python or a supplier sheet
| Situation | What happens | Fix |
|---|---|---|
| 5′ end assumed | Biopython's molecular_weight assumes a 5′-phosphate and gives 6,221.97 for the primer, 79.98 more | Use the same end in both tools |
| Salt form | Supplier sheets may quote the sodium salt, about 22 g/mol more per phosphate | Say "free acid" in your methods |
| Nearest-neighbour ε | Suppliers often quote nearest-neighbour extinction, about 5 to 15% lower for short oligos | Use the supplier's ε for their oligos |
| Tm method | Primer tools use nearest-neighbour Tm with Mg²⁺, often several degrees different | Name the method; test annealing with a gradient PCR |
| Lowercase input | Bases written in lowercase are not counted | Wrap the input in UPPER |
| Atomic weights | Rounded atomic weights shift the mass by a few hundredths | Negligible; quote two decimals |
9.5 Charting the result in Excel
- Select the base letters and counts (D2:E5) and choose Insert → Clustered Column.
- Colour the bars A green, C blue, G amber and T fuchsia to match the base colours used on this page.
- For element mass %, make a column of atoms × atomic weight ÷ MW and insert a doughnut chart.
- Put the length, GC% and MW in the chart title so the figure stands on its own.
9.6 Excel errors you will probably hit
| Excel shows | Why | Fix |
|---|---|---|
| Counts add up to less than the length | Lowercase letters, N bases or leftover spaces | Clean with UPPER and SUBSTITUTE; count N separately |
#DIV/0! | Empty extinction coefficient or path length | Fill in the ε and path length cells |
#NAME? | SEQUENCE or CONCAT in an old Excel | Use Excel 365, or reverse the sequence in R or Python |
| Concentration 1000 times too small | Forgot the × 1000 | mol/L × g/mol = g/L = mg/mL; × 1000 for ng/µL |
| Sequence became a number | Autoformat of a short sequence | Format the column as Text before pasting |
| Wrong counts after fill-down | B2 not locked | Use $B$2 in the count formula |
📈 10. How to Calculate Nucleic Acid Properties in R
In R, Biostrings handles the sequence: DNAString() or RNAString() holds it, letterFrequency() counts the monomers and reverseComplement() gives the other strand. The script below builds the chemical formula atom by atom, so the elements, molecular weight, extinction coefficient, concentration and Tm all match this calculator.
Rscript. Change only the lines under "Your data".Biostrings is a Bioconductor package: install it with install.packages("BiocManager") then BiocManager::install("Biostrings").
10.1 The complete script
R with Biostrings, saves nucleic_acid_plot.png
# Nucleic acid calculator in R: monomers, formula, elements, MW, GC, extinction,
# concentration from A260, Tm and bonds. Matches the StatsUnlock calculator.
library(Biostrings)
# ---- 1. Your data -------------------------------------------------------
seq_txt <- "ACGTGCTAGCTAGGCATCAG" # 5' to 3', DNA or RNA
mol <- "ssDNA" # ssDNA, dsDNA, ssRNA or dsRNA
five_p <- FALSE # TRUE if the 5' end carries a phosphate
circular <- FALSE # TRUE for a plasmid
a260 <- 0.25; dilution <- 10; path_cm <- 1; vol_ul <- 50; na_mM <- 50
# ---- 2. Clean the sequence ---------------------------------------------
s <- toupper(gsub("[^A-Za-z]", "", seq_txt))
rna <- grepl("RNA$", mol); ds <- grepl("^ds", mol)
s <- if (rna) chartr("T", "U", s) else chartr("U", "T", s)
x <- if (rna) RNAString(s) else DNAString(s)
n <- nchar(s)
bases <- if (rna) c("A", "C", "G", "U") else c("A", "C", "G", "T")
cnt <- letterFrequency(x, bases)
# ---- 3. Formula and molecular weight -----------------------------------
aw <- c(C = 12.011, H = 1.008, N = 14.007, O = 15.999, P = 30.974)
res <- if (rna) list(A = c(10, 12, 5, 6, 1), C = c(9, 12, 3, 7, 1), G = c(10, 12, 5, 7, 1), U = c(9, 11, 2, 8, 1)) else
list(A = c(10, 12, 5, 5, 1), C = c(9, 12, 3, 6, 1), G = c(10, 12, 5, 6, 1), T = c(10, 13, 2, 7, 1))
strand_formula <- function(k) {
f <- Reduce(`+`, Map(function(b, m) res[[b]] * m, names(k), k))
if (!circular) { f <- f + c(0, 2, 0, 1, 0); if (!five_p) f <- f - c(0, 1, 0, 3, 1) }
setNames(f, names(aw))
}
comp <- complement(x)
cnt2 <- letterFrequency(comp, bases)
form <- strand_formula(cnt) + if (ds) strand_formula(cnt2) else 0
mw <- sum(form * aw)
gc <- (cnt["G"] + cnt["C"]) / n * 100
# ---- 4. Extinction coefficient and concentration ------------------------
eps_nt <- c(A = 15400, C = 7400, G = 11500, T = 8700, U = 9900)
eps <- sum(cnt * eps_nt[bases]) + if (ds) sum(cnt2 * eps_nt[bases]) else 0
factor <- c(dsDNA = 50, ssDNA = 33, ssRNA = 40, dsRNA = 40)[mol]
conc <- if (ds) a260 * factor * dilution / path_cm else a260 / (eps * path_cm) * dilution * mw * 1000
uM <- conc * 1000 / mw
copies <- uM * 1e-12 * 6.02214076e23
# ---- 5. Melting temperature and bonds -----------------------------------
gcn <- unname(cnt["G"] + cnt["C"])
tm <- if (n < 14) 2 * (n - gcn) + 4 * gcn else if (n < 50) 64.9 + 41 * (gcn - 16.4) / n else 81.5 + 16.6 * log10(na_mM / 1000) + 0.41 * gc - 600 / n
pdb <- (if (circular) n else n - 1) * (if (ds) 2 else 1)
cat("Length:", n, "nt | composition:", paste(bases, cnt, collapse = ", "), "\n")
cat("Formula:", paste0(names(form), form, collapse = " "), "(no sulfur)\n")
cat(sprintf("MW = %.2f g/mol | GC = %.2f%% | eps260 = %d\n", mw, gc, eps))
cat(sprintf("Concentration = %.2f ng/uL = %.2f uM | copies/uL = %.3g | total = %.2f ug\n", conc, uM, copies, conc * vol_ul / 1000))
cat(sprintf("Tm = %.2f C | phosphodiester bonds = %d\n", tm, pdb))
cat("Reverse complement:", as.character(reverseComplement(x)), "\n")
# ---- 6. Figure: base counts and element mass % ---------------------------
png("nucleic_acid_plot.png", width = 2400, height = 1100, res = 300)
par(mfrow = c(1, 2), mar = c(4, 4, 3, 1))
barplot(cnt, col = c("#16a34a", "#2563eb", "#d97706", "#a21caf"), ylab = "Count",
main = sprintf("%d nt, GC %.1f%%", n, gc))
pct <- form * aw / mw * 100
barplot(pct, col = c("#475569", "#0891b2", "#2563eb", "#c2410c", "#d97706"), ylab = "Mass %",
main = sprintf("MW %.2f g/mol", mw))
dev.off()
Run it with Rscript nucleic_acid.R. For the worked example it prints C195 H245 N78 O117 P19, MW = 6142.04 g/mol, GC = 55.00%, eps260 = 217800, 70.50 ng/uL = 11.48 uM and Tm = 53.83 C.
10.2 What each part does
| Line or function | What it does, and why it is there |
|---|---|
| gsub("[^A-Za-z]", ...) | Drops spaces, digits and line breaks so a pasted GenBank block works. Use readDNAStringSet() for FASTA files. |
| chartr("T", "U", s) | Makes the letters match the chosen molecule, so RNA uses U. |
| letterFrequency(x, bases) | Counts each monomer in one call. |
| res and strand_formula() | Adds the atoms of each residue, then corrects the ends: + H₂O, and − HPO₃ for a 5′-OH. |
| complement(x) | The other strand, added for double-stranded molecules. |
| sum(form * aw) | Molecular weight from the formula, so the elements and mass can never disagree. |
| eps_nt[bases] | Nucleotide extinction coefficients at 260 nm. |
| conc and uM | Factor method for double strands, Beer-Lambert for single strands; then mass to molar. |
| tm | Picks Wallace, basic or salt-adjusted Tm by length, as the calculator does. |
| png(..., res = 300) | Saves a print-quality figure. dev.off() closes it; forget it and the PNG is empty. |
10.3 What the figure shows
The left panel shows how many of each base the molecule has, in the page's base colours. The right panel shows the share of the molecular weight from each element: carbon is the largest, phosphorus is about 9 to 10%, and there is no bar for sulfur.
10.4 Common R problems and fixes
| Problem | Cause | Fix |
|---|---|---|
| there is no package called Biostrings | Not installed, or installed with install.packages | Use BiocManager::install("Biostrings") |
| invalid character in DNAString | U in a DNA string or T in an RNA string | Let the chartr line convert it, or pick the right mol |
| Counts are NA | A base missing from letterFrequency's letters | Use the four letters of the right molecule |
| MW off by 79.98 | Different 5′ end from the other tool | Set five_p to match |
| Concentration too high for an oligo | Factor 33 instead of ε | Use the sequence-specific line for short oligos |
| Empty PNG | dev.off() never ran | Run the last lines, or call graphics.off() |
10.5 Useful one-liners
# Reverse complement and RNA version
reverseComplement(DNAString("ACGTGCTAGCTAGGCATCAG"))
RNAString(DNAString("ACGTGCTAGCTAGGCATCAG"))
# GC content as a fraction
letterFrequency(DNAString("ACGTGCTAGCTAGGCATCAG"), "GC", as.prob = TRUE)
# Dinucleotide counts (for nearest-neighbour extinction or Tm)
dinucleotideFrequency(DNAString("ACGTGCTAGCTAGGCATCAG"))
# Read every sequence in a FASTA file
seqs <- readDNAStringSet("primers.fasta"); width(seqs)📈 11. How to Calculate Nucleic Acid Properties in Python
Biopython's Seq object holds the sequence, and Bio.SeqUtils has molecular_weight and MeltingTemp. The script below builds the formula the same way as the R version, prints the same numbers, and then cross-checks the mass and Wallace Tm against Biopython's own functions.
Install once with pip install biopython matplotlib.
11.1 The complete script
Python 3 with Biopython, saves nucleic_acid_plot.png
"""Nucleic acid calculator in Python: monomers, formula, elements, MW, GC, extinction,
concentration from A260, Tm and bonds. Matches the StatsUnlock calculator."""
import math, re
from collections import Counter
from Bio.Seq import Seq
from Bio.SeqUtils import molecular_weight
from Bio.SeqUtils import MeltingTemp as mt
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
# ---- 1. Your data -------------------------------------------------------
seq_txt = "ACGTGCTAGCTAGGCATCAG" # 5' to 3', DNA or RNA
mol = "ssDNA" # ssDNA, dsDNA, ssRNA or dsRNA
five_p = False # True if the 5' end carries a phosphate
circular = False # True for a plasmid
a260, dilution, path_cm, vol_ul, na_mM = 0.25, 10, 1, 50, 50
# ---- 2. Clean the sequence ---------------------------------------------
s = re.sub(r"[^A-Za-z]", "", seq_txt).upper()
rna, ds = mol.endswith("RNA"), mol.startswith("ds")
s = s.replace("T", "U") if rna else s.replace("U", "T")
seq = Seq(s)
n = len(s)
bases = "ACGU" if rna else "ACGT"
cnt = Counter(s)
# ---- 3. Formula and molecular weight -----------------------------------
AW = dict(C=12.011, H=1.008, N=14.007, O=15.999, P=30.974)
RES = (dict(A=(10, 12, 5, 6, 1), C=(9, 12, 3, 7, 1), G=(10, 12, 5, 7, 1), U=(9, 11, 2, 8, 1)) if rna else
dict(A=(10, 12, 5, 5, 1), C=(9, 12, 3, 6, 1), G=(10, 12, 5, 6, 1), T=(10, 13, 2, 7, 1)))
def strand_formula(k):
f = [0, 0, 0, 0, 0]
for b, m in k.items():
if b in RES:
f = [a + m * r for a, r in zip(f, RES[b])]
if not circular:
f[1] += 2; f[3] += 1 # + H2O for the chain ends
if not five_p:
f[1] -= 1; f[3] -= 3; f[4] -= 1 # 5'-OH end: one phosphate fewer
return dict(zip("CHNOP", f))
comp = seq.complement_rna() if rna else seq.complement()
cnt2 = Counter(str(comp))
form = strand_formula(cnt)
if ds:
f2 = strand_formula(cnt2)
form = {e: form[e] + f2[e] for e in form}
mw = sum(AW[e] * k for e, k in form.items())
gc = (cnt["G"] + cnt["C"]) / n * 100
# ---- 4. Extinction coefficient and concentration ------------------------
EPS = dict(A=15400, C=7400, G=11500, T=8700, U=9900)
eps = sum(EPS[b] * cnt[b] for b in bases) + (sum(EPS[b] * cnt2[b] for b in bases) if ds else 0)
FACTOR = dict(dsDNA=50, ssDNA=33, ssRNA=40, dsRNA=40)
conc = a260 * FACTOR[mol] * dilution / path_cm if ds else a260 / (eps * path_cm) * dilution * mw * 1000
uM = conc * 1000 / mw
copies = uM * 1e-12 * 6.02214076e23
# ---- 5. Melting temperature and bonds -----------------------------------
gcn = cnt["G"] + cnt["C"]
if n < 14: tm = 2 * (n - gcn) + 4 * gcn
elif n < 50: tm = 64.9 + 41 * (gcn - 16.4) / n
else: tm = 81.5 + 16.6 * math.log10(na_mM / 1000) + 0.41 * gc - 600 / n
pdb = (n if circular else n - 1) * (2 if ds else 1)
print(f"Length: {n} nt | composition:", ", ".join(f"{b} {cnt[b]}" for b in bases))
print("Formula:", " ".join(f"{e}{k}" for e, k in form.items()), "(no sulfur)")
print(f"MW = {mw:.2f} g/mol | GC = {gc:.2f}% | eps260 = {eps}")
print(f"Concentration = {conc:.2f} ng/uL = {uM:.2f} uM | copies/uL = {copies:.3g} | total = {conc * vol_ul / 1000:.2f} ug")
print(f"Tm = {tm:.2f} C | phosphodiester bonds = {pdb}")
print("Reverse complement:", seq.reverse_complement_rna() if rna else seq.reverse_complement())
# Cross-checks with Biopython's own functions (Biopython assumes a 5'-phosphate)
print(f"Biopython molecular_weight (5'-phosphate): {molecular_weight(seq, 'RNA' if rna else 'DNA', double_stranded=ds, circular=circular):.2f}")
print(f"Biopython Tm_Wallace: {mt.Tm_Wallace(seq):.2f}")
# ---- 6. Figure: base counts and element mass % ---------------------------
fig, ax = plt.subplots(1, 2, figsize=(8, 3.6))
ax[0].bar(list(bases), [cnt[b] for b in bases], color=["#16a34a", "#2563eb", "#d97706", "#a21caf"])
ax[0].set(ylabel="Count", title=f"{n} nt, GC {gc:.1f}%")
ax[1].bar(list(form), [AW[e] * k / mw * 100 for e, k in form.items()], color=["#475569", "#0891b2", "#2563eb", "#c2410c", "#d97706"])
ax[1].set(ylabel="Mass %", title=f"MW {mw:.2f} g/mol")
fig.tight_layout()
fig.savefig("nucleic_acid_plot.png", dpi=300)
11.2 What each part does
| Line or function | What it does, and why it is there |
|---|---|
| re.sub(r"[^A-Za-z]", ...) | Cleans the pasted text. Bio.SeqIO reads FASTA files directly if you prefer. |
| Counter(s) | Counts each monomer. |
| strand_formula() | Adds residue atoms, then corrects the chain ends. |
| seq.complement() | The other strand, added for double-stranded molecules. Use complement_rna() for RNA. |
| sum(AW[e] * k ...) | Molecular weight from the formula. |
| conc, uM, copies | Factor or Beer-Lambert concentration, then molar units and copy number. |
| molecular_weight(...) | Biopython's own mass, which assumes a 5′-phosphate: 6,221.97 for the primer, exactly 79.98 above the 5′-OH value. |
| mt.Tm_Wallace(seq) | Biopython's Wallace rule: 62.00 for the primer, the same as this page's Wallace value. |
| fig.savefig(..., dpi=300) | Saves a print-quality figure. In Jupyter, replace it with plt.show(). |
11.3 What the figure shows
The same two panels as the R figure: base counts on the left and element mass % on the right, with the length, GC content and molecular weight in the titles.
11.4 Common Python problems and fixes
| Problem | Cause | Fix |
|---|---|---|
| ValueError: 'U' is not a valid unambiguous letter for DNA | RNA letters passed as DNA to molecular_weight | Pass seq_type="RNA" |
| MW 79.98 higher than this page | Biopython assumes a 5′-phosphate | Set five_p = True to compare like with like |
| Tm_NN differs from the basic formula | Nearest-neighbour model with its own salt defaults | Name the method; pass Na and Mg to Tm_NN |
| ModuleNotFoundError: Bio | Installed the wrong package name | pip install biopython, not bio |
| Counts missing a base | Lowercase or spaces left in | Keep the re.sub and upper() lines |
| Empty figure in a script | plt.show() with the Agg backend | Use savefig, as the script does |
11.5 Useful one-liners
# Reverse complement and transcription
Seq("ACGTGCTAGCTAGGCATCAG").reverse_complement() # CTGATGCCTAGCTAGCACGT
Seq("ACGTGCTAGCTAGGCATCAG").transcribe() # ACGUGCUAGCUAGGCAUCAG
# GC content (Biopython 1.80 or newer)
from Bio.SeqUtils import gc_fraction
gc_fraction("ACGTGCTAGCTAGGCATCAG") # 0.55
# Nearest-neighbour melting temperature
from Bio.SeqUtils import MeltingTemp as mt
mt.Tm_NN("ACGTGCTAGCTAGGCATCAG", Na=50)
# Double-stranded and circular molecular weight
from Bio.SeqUtils import molecular_weight
molecular_weight("ACGTGCTAGCTAGGCATCAG", "DNA", double_stranded=True)Run it with python nucleic_acid.py from a terminal. In Jupyter, drop the savefig line and add plt.show().
📋 12. Detailed Reference Tables
12.1 The monomers of nucleic acids: nucleotide values used here
| Nucleotide (monomer) | In | Base | Type | Residue formula in a chain | Residue mass (g/mol) | ε260 (M⁻¹cm⁻¹) |
|---|---|---|---|---|---|---|
| Deoxyadenosine monophosphate (dAMP) | DNA | A Adenine | Purine | C10H12N5O5P1 | 313.210 | 15,400 |
| Deoxycytidine monophosphate (dCMP) | DNA | C Cytosine | Pyrimidine | C9H12N3O6P1 | 289.184 | 7,400 |
| Deoxyguanosine monophosphate (dGMP) | DNA | G Guanine | Purine | C10H12N5O6P1 | 329.209 | 11,500 |
| Deoxythymidine monophosphate (dTMP) | DNA | T Thymine | Pyrimidine | C10H13N2O7P1 | 304.195 | 8,700 |
| Adenosine monophosphate (AMP) | RNA | A Adenine | Purine | C10H12N5O6P1 | 329.209 | 15,400 |
| Cytidine monophosphate (CMP) | RNA | C Cytosine | Pyrimidine | C9H12N3O7P1 | 305.183 | 7,400 |
| Guanosine monophosphate (GMP) | RNA | G Guanine | Purine | C10H12N5O7P1 | 345.208 | 11,500 |
| Uridine monophosphate (UMP) | RNA | U Uracil | Pyrimidine | C9H11N2O8P1 | 306.167 | 9,900 |
What to conclude: every nucleotide has exactly one phosphorus atom, so a strand's phosphorus count equals its phosphate count, and G is the heaviest base while C is the lightest. Atomic weights are IUPAC standard values; extinction coefficients are the nucleotide values used for summed ε (Cavaluzzi and Borer, 2004).
12.2 The four macromolecules: carbohydrates, lipids, proteins and nucleic acids
| Macromolecule | Monomer (building block) | Polymer examples | Bond joining monomers | Elements | Main functions |
|---|---|---|---|---|---|
| Carbohydrates | Monosaccharide (glucose) | Starch, glycogen, cellulose | Glycosidic bond | C, H, O | Energy, energy storage, structure |
| Lipids | Fatty acids and glycerol (not true polymers) | Triglycerides, phospholipids, steroids | Ester bond | C, H, O (P in phospholipids) | Energy storage, membranes, hormones |
| Proteins | Amino acid | Enzymes, haemoglobin, collagen | Peptide bond | C, H, O, N, S | Catalysis, structure, transport, signalling |
| Nucleic acids | Nucleotide | DNA, RNA | Phosphodiester bond | C, H, O, N, P | Store and express genetic information |
What to conclude: all four are built by condensation (water released) and broken down by hydrolysis. Of the four macromolecules, only nucleic acids carry heritable information.
12.3 Examples of nucleic acids
| Nucleic acid | Type | Typical size | Function |
|---|---|---|---|
| Chromosomal (nuclear) DNA | dsDNA, linear | About 3.1 billion bp per human haploid genome | Stores the genome |
| Mitochondrial DNA | dsDNA, circular | 16,569 bp in humans | Encodes 13 respiratory chain proteins, 22 tRNAs and 2 rRNAs |
| Plasmid DNA | dsDNA, circular | About 1,000 to 200,000 bp | Extra genes in bacteria; cloning vectors in the lab |
| Messenger RNA (mRNA) | ssRNA | Hundreds to thousands of nt | Carries a gene's code to the ribosome |
| Transfer RNA (tRNA) | ssRNA, cloverleaf | About 76 to 90 nt | Brings amino acids to the ribosome |
| Ribosomal RNA (rRNA) | ssRNA | About 120 to 5,000 nt | Builds the ribosome and forms peptide bonds |
| microRNA and siRNA | Short RNA | About 21 to 23 nt | Switch genes off (RNA interference) |
| Viral genomes | DNA or RNA, single or double | A few thousand to over a million nt | Carry a virus's genes; SARS-CoV-2 is about 30,000 nt of RNA |
| Primers and probes | Synthetic ssDNA | 18 to 30 nt | Start PCR and detect sequences |
What to conclude: two examples of nucleic acids are DNA and RNA, but each comes in many forms. All of them are polymers of nucleotides with the same backbone.
12.4 Nucleotide vs nucleoside vs nucleic acid (and is ATP a nucleic acid?)
| Molecule | What it contains | Example | Is it a nucleic acid? |
|---|---|---|---|
| Nitrogenous base | Base only | Adenine | No, part of a monomer |
| Nucleoside | Base + sugar | Adenosine | No |
| Nucleotide | Base + sugar + 1 to 3 phosphates | AMP, dAMP | No, it is the monomer |
| ATP | Adenine + ribose + 3 phosphates | Adenosine triphosphate | No. ATP is a nucleotide, used for energy and as a building block when RNA is made |
| Dinucleotide coenzymes | Two nucleotides | NAD⁺, FAD | No, too short and not a genetic polymer |
| Nucleic acid | Many nucleotides joined by phosphodiester bonds | DNA, RNA | Yes, the polymer |
What to conclude: nucleotide vs nucleic acid is monomer vs polymer. When RNA polymerase adds ATP to a chain, two phosphates are released and only AMP stays in the RNA.
12.5 Foods with nucleic acids
Every food made of cells contains nucleic acids, because every cell has DNA and RNA. Foods made of many small, active cells contain the most per gram. Your gut breaks dietary nucleic acids into nucleotides, nucleosides and bases; the purine bases (A and G) are broken down to uric acid, which is why people with gout are told to limit high-purine foods.
| Nucleic acid content | Example foods | Why |
|---|---|---|
| Very high | Brewer's yeast, yeast extract spreads, organ meats (liver, kidney, sweetbreads) | Dense in cells with lots of RNA |
| High | Sardines, anchovies, herring, mackerel, mussels, scallops, shrimp | Small whole fish and shellfish |
| Moderate | Beef, pork, chicken, dried beans, lentils, peas, mushrooms, spinach, asparagus | Muscle and plant tissue |
| Low | Milk, cheese, eggs, fruit, refined grains, most vegetables | Few cells per gram, or cell-free (milk) |
What to conclude: an example of a nucleic acid in food is the DNA and RNA in sardines or liver. Nucleic acids are not an essential nutrient, because the body makes its own nucleotides. This table is a general guide, not dietary advice; ask a doctor or dietitian about a low-purine diet.
12.6 A260 conversion factors and purity ratios
| Sample | ng/µL per A260 unit | Good A260/A280 | Good A260/A230 |
|---|---|---|---|
| dsDNA | 50 | about 1.8 | 2.0 to 2.2 |
| ssDNA | 33 | about 1.8 | 2.0 to 2.2 |
| RNA | 40 | about 2.0 | 2.0 to 2.2 |
| Short oligo | Use the sequence-specific ε | Depends on sequence | 2.0 to 2.2 |
What to conclude: a low A260/A280 suggests protein or phenol; a low A260/A230 suggests guanidine salts, EDTA or carbohydrate carry-over. The ratios depend on the pH and salt of the buffer (Wilfinger et al., 1997).
📈 13. Nucleic Acid Examples: 8 Worked Results
Eight worked examples, from a PCR primer to a plasmid. Every number below came from this calculator, and each can be loaded from the sample list in Section 2.
A 20-nt PCR primer, start to finish
The worked example used in Sections 7, 9, 10 and 11.
A synthetic primer, 5′-ACGTGCTAGCTAGGCATCAG-3′ with a 5′-OH, was diluted 1 in 10 and read at A260 = 0.25.
| Quantity | Value | Note |
|---|---|---|
| Formula | C195H245N78O117P19 | C, H, N, O and P only |
| Molecular weight | 6,142.04 g/mol | Residues 6,204.00 + 18.02 − 79.98 |
| Extinction coefficient | 217,800 M⁻¹cm⁻¹ | 1 A260 unit = 28.20 µg/mL |
| Concentration | 70.50 ng/µL = 11.48 µM | 6.91 × 1012 copies/µL |
| Tm (basic) | 53.83 °C | Anneal at about 50 °C |
What it means: The reading is in the linear range, so the sequence-specific answer of 70.50 ng/µL is reliable. The factor of 33 would have said 82.50 ng/µL, 17% too high, which matters when you dilute primers to an exact micromolar stock.
How to write it: “The primer (6,142.04 g/mol, ε260 = 217,800 M⁻¹cm⁻¹) was quantified at 70.50 ng/µL (11.48 µM) by A260.”
A 120-bp PCR product
Double-stranded DNA, measured with the factor of 50.
A PCR amplicon with a 5′-phosphate on each strand was read undiluted at A260 = 0.42; 30 µL were recovered.
| Quantity | Value | Note |
|---|---|---|
| Molecular weight | 74,189.84 g/mol | Both strands, about 618 per bp |
| Concentration | 21.00 ng/µL | 0.42 × 50 |
| Molar | 283.1 nM | Use this for ligation ratios |
| Yield | 0.63 µg in 30 µL | 8.49 pmol |
| Bonds | 306 hydrogen, 238 phosphodiester | Helix 40.8 nm long |
What it means: A 3:1 insert-to-vector ligation with 50 ng of a 3 kb vector needs only 3 × 50 × 120 ÷ 3,000 = 6 ng of this 120-bp insert: dilute the product 1 in 10 and add about 2.9 µL. Working in picomoles avoids the classic mistake of adding equal nanograms.
How to write it: “The 120-bp amplicon (74.19 kDa) was recovered at 21.00 ng/µL (0.63 µg total).”
An siRNA guide strand
RNA uses ribose and uracil, and its own factor of 40.
A 21-nt siRNA strand, GCAAGCUGACCCUGAAGUUCA, was diluted 1 in 20 and read at A260 = 0.8.
| Quantity | Value | Note |
|---|---|---|
| Formula | C200H249N81O143P20 | More O than DNA: the 2′-OH |
| Molecular weight | 6,695.10 g/mol | About 319 g/mol per nt |
| Extinction coefficient | 233,900 M⁻¹cm⁻¹ | U 9,900 instead of T 8,700 |
| Concentration | 457.98 ng/µL | 68.41 µM |
| Total | 45.80 µg in 100 µL | 6.84 nmol |
What it means: A 68 µM stock is easy to dilute to the 20 µM most siRNA protocols ask for. The same sequence as DNA (T for U) would weigh 279.87 g/mol less: each ribose carries one more oxygen, partly offset by the methyl group on thymine.
How to write it: “The siRNA guide strand (6,695.10 g/mol) was resuspended at 68.4 µM.”
A 3,000-bp plasmid as a qPCR standard
Circular DNA has no ends, so it has as many phosphodiester bonds as nucleotides.
A miniprep of a 3 kb plasmid was diluted 1 in 50 and read at A260 = 0.6.
| Quantity | Value | Note |
|---|---|---|
| Molecular weight | 1,853,742.45 g/mol | Both strands, no end correction |
| Concentration | 1,500.00 ng/µL | 0.6 × 50 × 50 |
| Copies | 4.873 × 1011 per µL | For a qPCR standard curve |
| Phosphodiester bonds | 6,000 | 3,000 per strand in a closed circle |
| Tm (salt) | 80.83 °C | At 50 mM Na⁺ |
What it means: Copies per microlitre is what a qPCR standard curve needs. A 10-fold series from this stock gives 4.87 × 1010, 4.87 × 109 and so on; most curves start near 107 copies per reaction.
How to write it: “The plasmid standard (3,000 bp, 1.85 MDa) was quantified at 1,500 ng/µL, equal to 4.87 × 1011 copies/µL.”
GC-rich vs AT-rich DNA
Same length, very different stability.
Two 80-bp double-stranded fragments, one 72.5% GC (a CpG island) and one 18.75% GC (Plasmodium-like), were compared.
| Quantity | Value | Note |
|---|---|---|
| GC-rich Tm | 82.13 °C | 81.5 − 21.60 + 29.73 − 7.50 |
| AT-rich Tm | 60.09 °C | 81.5 − 21.60 + 7.69 − 7.50 |
| Hydrogen bonds | 218 vs 175 | G–C pairs have 3, A–T pairs 2 |
| Molecular weight | 49,485.73 vs 49,443.25 | Almost the same: pair masses are similar |
| 1 A260 unit | 30.43 vs 26.73 µg/mL | Summed ε; real dsDNA about 50 |
What it means: Each 1% of GC adds 0.41 °C, so the 53.75-point gap gives 22 °C. GC-rich templates need higher denaturing temperatures or additives such as DMSO; AT-rich ones need lower annealing temperatures.
How to write it: “The GC-rich fragment had a predicted Tm 22.04 °C higher than the AT-rich fragment of the same length.”
The human telomere repeat
A real nucleic acid sequence with no cytosine at all.
Eight copies of the telomere repeat TTAGGG (48 nt, single-stranded) were diluted 1 in 10 and read at A260 = 0.6.
| Quantity | Value | Note |
|---|---|---|
| Composition | 8 A, 0 C, 24 G, 16 T | G-rich strand |
| Molecular weight | 15,211.85 g/mol | 5′-OH |
| Concentration | 169.52 ng/µL | 11.14 µM |
| Tm (basic) | 71.39 °C | For pairing with its complement |
| Structure note | G-quadruplex | Runs of G can fold into four-stranded structures |
What it means: Telomeres cap chromosome ends. Their G-rich strand can fold into G-quadruplexes, so its real absorbance may differ from the summed extinction coefficient; treat concentrations of G-rich oligos as approximate.
How to write it: “The (TTAGGG)8 oligonucleotide (15,211.85 g/mol) was quantified at 169.52 ng/µL.”
An A260 reading that is too high
The numbers are calculated, but the badge says read again.
A poly(dA) 30-mer with a 5′-phosphate was read undiluted at A260 = 1.5.
| Quantity | Value | Note |
|---|---|---|
| Molecular weight | 9,414.32 g/mol | 5′-phosphate adds 79.98 |
| Extinction coefficient | 462,000 | 30 × 15,400 |
| Calculated concentration | 30.57 ng/µL | Probably too low |
| Verdict | A260 TOO HIGH | Above the linear range |
| Fix | Dilute 1 in 10 | Expect about 0.15; enter dilution 10 |
What it means: Above about A260 1.0 detectors saturate and stray light flattens the reading, so the true concentration is likely higher. Dilute 1 in 10, read again and enter the dilution factor.
How to write it: “A260 exceeded the linear range; the sample was diluted 1:10 and re-measured before quantification.”
A messy read with N bases and a weak signal
What the tool does with real-world input.
A FASTA block with a header, line numbers, lowercase letters and three N bases was pasted, with A260 = 0.05.
| Quantity | Value | Note |
|---|---|---|
| Cleaned length | 28 nt | Header, numbers and spaces removed |
| Unknown bases | 3 N | Add no mass and no absorbance |
| Molecular weight | 7,666.03 g/mol | Too low by about 3 nucleotides |
| Concentration | 1.40 ng/µL | Below the reliable range |
| Verdict | A260 TOO LOW | Use a fluorescent dye assay |
What it means: Two problems stack up here: the N bases make the mass and ε too small, and A260 0.05 is in the noise. Re-sequence to resolve the Ns, and measure with a dye assay instead.
How to write it: “The sample was below the spectrophotometric detection range (A260 = 0.05) and was quantified fluorometrically.”
🧪 14. Bench Protocol: Measuring a Nucleic Acid by UV Absorbance
Study design: UV absorbance at 260 nm is the quickest way to measure how much nucleic acid you have. This protocol gives the A260 reading the calculator turns into ng/µL, µM and copies (Desjardins and Conklin, 2010).
Prepare
- Know your molecule. Decide whether it is dsDNA, ssDNA or RNA, and for oligos have the sequence ready to paste here for the extinction coefficient.
- Mix the sample. Flick or pipette gently; vortexing shears genomic DNA. Spin down briefly. Thaw RNA on ice.
- Choose the blank. Use exactly the buffer the sample is in (water, TE or elution buffer), because EDTA and salts change the reading.
Set up
- Warm up and clean the instrument. Wipe the pedestal with water and a lint-free tissue, or use a clean quartz or UV-transparent cuvette.
- Blank the instrument. Load 1 to 2 µL of buffer on a microvolume spectrophotometer (or 1 mL in a cuvette) and set the zero.
- Plan a dilution. For a cuvette, dilute so A260 falls between 0.1 and 1.0, for example 5 µL in 495 µL (dilution factor 100).
Run
- Read A260, A280 and A230. Measure each sample in duplicate with a fresh drop each time, and wipe between samples.
- Check the spectrum. A clean nucleic acid shows a peak at 260 nm and a dip at 230 nm. A peak shifted towards 270 nm or a high 230 nm value means contamination.
- Enter the values here. Type A260, the dilution factor and path length into Section 2 and press Calculate.
Record
- Record concentration and purity. Note ng/µL, µM, A260/A280 and A260/A230 for each tube.
- Confirm on a gel or with a dye. For low concentrations (A260 under 0.1) or when RNA may contaminate DNA, use a fluorescent dye assay specific to dsDNA or RNA.
| Sample | A260 (DF) | This tool | A260/A280 | Verdict |
|---|---|---|---|---|
| Primer F1 | 0.25 (10) | 70.50 ng/µL, 11.48 µM | 1.85 | Use |
| Miniprep 3 | 0.60 (50) | 1,500.00 ng/µL | 1.88 | Use; dilute for transfection |
| RNA prep 2 | 0.05 (1) | 2.00 ng/µL | 1.42 | Too dilute and impure: re-extract |
Replicates: read each sample at least twice; if the two readings differ by more than 10%, mix the tube and read again.
Lab notebook: sample name, buffer used as blank, instrument, A260, A280, A230, dilution, path length, calculated concentration and the method (factor or extinction coefficient).
Common mistakes that spoil a nucleic acid measurement:
- Blanking with water when the sample is in TE or elution buffer.
- Reading a sample above A260 1.0 instead of diluting it.
- Using the dsDNA factor of 50 for a short primer.
- A bubble or a dried drop on the pedestal.
- Treating an RNA-contaminated DNA prep as pure DNA: A260 counts both.
🎯 15. When to Use This Nucleic Acid Calculator
Use it when:
- ✓ You need the molecular weight, formula or elements of a DNA or RNA sequence.
- ✓ You have an A260 reading and need ng/µL, µM or copies per µL.
- ✓ You are making a primer stock and need the micromolar concentration.
- ✓ You want GC content, Tm, complement or reverse complement in one place.
- ✓ You are learning nucleic acid structure and want real numbers for monomers and bonds.
Use something else when:
- ✗ You need a precise primer Tm with Mg²⁺ and dNTPs: use a nearest-neighbour Tm tool.
- ✗ Your oligo has modifications (dyes, phosphorothioates, LNA): use the supplier's mass.
- ✗ Your sample is very dilute or impure: use a fluorescent dye assay or qPCR.
- ✗ You need the protein a gene makes: use a translation or protein synthesis tool.
Real-world examples:
- Biology class: working out the elements and bonds in a short DNA strand.
- PCR set-up: diluting a primer from its A260 to 10 µM.
- qPCR standards: converting a plasmid concentration to copies per µL.
- Cloning: getting picomoles of insert and vector for a ligation.
Experimental design: calculate the oligo's MW and ε when you order it, measure A260 when it arrives, and recalculate after every dilution you store.
Decision tree: Do you have a sequence? No → use the Manual Base Counts tab, or for long dsDNA the factor of 50. Yes → Is it a short oligo? Yes → use the sequence-specific ε. No → Double-stranded? Yes → factor 50 (DNA) or 40 (RNA). No → use this nucleic acid calculator with the ε method.
🔧 16. Troubleshooting and Common Errors
The tool says the sequence looks like a protein
Cause: Fewer than 85% of the letters are A, C, G, T, U or N, so you probably pasted an amino acid sequence.
Fix: Paste the DNA or RNA sequence instead. If you only have the protein, back-translate it first.
The tool says the sequence contains both T and U
Cause: DNA uses T and RNA uses U; a mixture usually means two sequences were pasted together or a typo.
Fix: Use T for DNA or U for RNA. The calculator converts letters to match the type you choose.
My molecular weight is 79.98 g/mol different from another tool
Cause: The other tool assumes a different 5 prime end. Biopython and many web tools assume a 5 prime phosphate; synthetic oligos usually have a 5 prime hydroxyl.
Fix: Set the 5 prime end to match, and say which you used in your methods.
My concentration is very different from the NanoDrop
Cause: The instrument used the default factor (33 for ssDNA), while this calculator used the sequence-specific extinction coefficient, or the dilution factor was not entered.
Fix: Choose the factor method to match the instrument, or enter the oligo's extinction coefficient in the instrument. Check the dilution factor.
The badge says A260 TOO HIGH
Cause: Above about 1.0 absorbance is no longer proportional to concentration, so the result is underestimated.
Fix: Dilute the sample (1 in 10 is usual), enter the new dilution factor and read again.
The badge says A260 TOO LOW
Cause: Below 0.1 the reading is close to the instrument's noise, so small errors become large percentage errors.
Fix: Concentrate the sample, read it undiluted, or use a fluorescent dye assay.
There is a warning about N bases
Cause: N means an unknown base. It adds no mass and no absorbance, so the molecular weight and extinction coefficient are slightly low.
Fix: Replace N with the real base if you know it, or accept that the mass is approximate.
The Tm here differs from my primer design software
Cause: Primer tools usually use nearest-neighbour thermodynamics with magnesium and dNTPs; this page uses simpler formulas.
Fix: Use this Tm as a guide, set annealing about 3 to 5 degrees below it, and confirm with a gradient PCR.
The charts did not appear
Cause: Chart.js did not load, usually because of an ad blocker or no internet connection.
Fix: Every number in the cards and tables is still correct. Allow cdnjs.cloudflare.com or reload the page.
⚖ 17. Assumptions and Limitations
Assumptions
- The sequence is complete and unmodified. Requires only A, C, G, T or U. When it fails (modified bases, dyes), the mass and ε are wrong by the mass of the modification.
- The ends are as selected. Requires the right 5′ end and shape. When it fails, the mass is off by 79.98 g/mol per strand (5′-OH vs phosphate).
- Free acid form. Requires reporting the neutral molecule. Sodium salts weigh about 22 g/mol more per phosphate, so a 20-mer salt is about 420 g/mol heavier.
- Extinction coefficients add up. Requires no base stacking. Real strands absorb a little less than the sum, so the summed ε is slightly too high and the concentration slightly too low; short oligos differ by about 5 to 15% from nearest-neighbour values.
- A260 comes only from this molecule. Requires a pure sample. Contaminating RNA, nucleotides or phenol all add absorbance, so the concentration is overestimated.
- Simple Tm models. Require standard salt and no Mg²⁺. In PCR buffer, real Tm is often several degrees higher than these estimates.
Limitations
- No nearest-neighbour thermodynamics. Use a dedicated primer design tool for precise Tm and hairpins.
- No secondary structure. RNA folding and DNA hairpins are not predicted.
- No modifications. Methylation, fluorophores and backbone changes are ignored.
- No purity check. Enter purity ratios in your notebook and check on a gel.
- Sequences up to a few megabases. For whole genomes, use R or Python.
- Average atomic weights. For mass spectrometry, calculate monoisotopic masses.
🏁 18. Conclusion
A nucleic acid is a polymer of nucleotides, built from five elements, held together by phosphodiester bonds along each strand and hydrogen bonds between strands. DNA stores genetic information and RNA puts it to use. This calculator turns any DNA or RNA sequence into its monomers, formula, molecular weight, concentration, melting temperature and bonds.
What was found
___
What it means at the bench
___
Cautions
___
Next steps
___
Whether you are learning what nucleic acids are made of or making a primer stock, the logic is the same: count the monomers, add up the atoms, and convert absorbance into amount.
❓ 19. Frequently Asked Questions About Nucleic Acids
Q1. What is a nucleic acid?
A nucleic acid is a large biological molecule made of a chain of nucleotides. Nucleic acids store and carry genetic information in every living cell and in viruses. The two types are DNA and RNA.
Q2. What is the monomer of a nucleic acid?
The monomer of a nucleic acid is a nucleotide. Each nucleotide has three parts: a phosphate group, a five-carbon sugar (deoxyribose in DNA, ribose in RNA) and a nitrogenous base (A, G, C, and T in DNA or U in RNA).
Q3. What is the polymer of nucleic acids?
The polymer of nucleic acids is a polynucleotide: a chain of nucleotides joined by phosphodiester bonds. DNA and RNA are the two nucleic acid polymers. So nucleic acids are polymers of nucleotides.
Q4. What are the two types of nucleic acids?
The two types of nucleic acids are DNA (deoxyribonucleic acid) and RNA (ribonucleic acid). DNA has deoxyribose and thymine and is usually double-stranded; RNA has ribose and uracil and is usually single-stranded.
Q5. What are some examples of nucleic acids?
Examples of nucleic acids are chromosomal DNA, mitochondrial DNA, plasmid DNA, messenger RNA (mRNA), transfer RNA (tRNA), ribosomal RNA (rRNA), microRNA, and the DNA or RNA genomes of viruses.
Q6. What is the function of nucleic acids?
The main function of nucleic acids is to store, copy and express genetic information. DNA stores the instructions and passes them to new cells; RNA carries the instructions to ribosomes, helps build proteins, catalyses some reactions and regulates genes.
Q7. What elements are in nucleic acids?
Nucleic acids contain five elements: carbon, hydrogen, oxygen, nitrogen and phosphorus (CHONP). Nitrogen is in the bases and phosphorus is in the phosphate backbone.
Q8. Do nucleic acids contain sulfur?
No. Nucleic acids do not contain sulfur, while most proteins do (in methionine and cysteine). Hershey and Chase used this in 1952: radioactive sulfur labelled phage protein, radioactive phosphorus labelled phage DNA, and only the phosphorus entered the bacteria, showing DNA is the genetic material.
Q9. What is the structure of nucleic acids?
A nucleic acid has a sugar-phosphate backbone, with the sugars linked by phosphodiester bonds, and a base attached to each sugar. DNA usually forms a right-handed double helix of two antiparallel strands joined by base pairs: A with T by two hydrogen bonds and G with C by three.
Q10. What are the building blocks of nucleic acids?
The building blocks of nucleic acids are nucleotides, and each nucleotide is built from a phosphate, a pentose sugar and one of five bases: adenine, guanine, cytosine, thymine or uracil.
Q11. What is the difference between a nucleotide and a nucleic acid?
A nucleotide is a single monomer; a nucleic acid is the polymer made of many nucleotides joined together. The relationship is the same as between an amino acid and a protein.
Q12. Is ATP a nucleic acid?
No. ATP (adenosine triphosphate) is a nucleotide, not a nucleic acid. It is a single unit with three phosphates, used as the cell's energy carrier and as one of the building blocks that RNA polymerase adds when it makes RNA.
Q13. Is DNA a nucleic acid? Is RNA a nucleic acid?
Yes to both. DNA (deoxyribonucleic acid) and RNA (ribonucleic acid) are the two types of nucleic acids.
Q14. What bonds are in nucleic acids?
Phosphodiester bonds join nucleotides along each strand, hydrogen bonds join base pairs between strands (two for A-T or A-U, three for G-C), and N-glycosidic bonds join each base to its sugar. Base stacking adds further stability.
Q15. What foods contain nucleic acids?
All foods made of cells contain nucleic acids. Brewer's yeast, yeast extract, organ meats such as liver and kidney, and small oily fish such as sardines and anchovies are among the richest. Milk, eggs and fruit contain little.
Q16. How are proteins and nucleic acids related?
Nucleic acids carry the code for proteins: the base sequence of a gene sets the amino acid sequence, three bases per amino acid. Proteins in turn copy, read, repair and package nucleic acids, for example DNA polymerase and histones.
Q17. How do the four macromolecules compare: carbohydrates, lipids, proteins and nucleic acids?
Carbohydrates are built from monosaccharides and contain C, H and O; lipids from fatty acids and glycerol, mostly C, H and O; proteins from amino acids, with C, H, O, N and S; and nucleic acids from nucleotides, with C, H, O, N and P. Only nucleic acids carry genetic information.
Q18. How do you calculate the concentration of a nucleic acid from A260?
Multiply A260 by the dilution factor and a conversion factor: 50 ng per microlitre for dsDNA, 40 for RNA and 33 for ssDNA. For short oligos, divide A260 by the sequence-specific extinction coefficient and multiply by the molecular weight, as this calculator does.
Q19. How do you calculate the molecular weight of DNA or RNA?
Add the residue mass of each nucleotide, add 18.02 for water at the chain ends, and subtract 79.98 if the 5 prime end is a hydroxyl. The worked primer ACGTGCTAGCTAGGCATCAG weighs 6,142.04 g/mol. Roughly, DNA is about 309 g/mol per nucleotide and RNA about 321.
Q20. How do you use nucleic acid in a sentence?
Three examples: "DNA and RNA are the two kinds of nucleic acid found in cells." "The lab extracted nucleic acid from the blood sample before running PCR." "A nucleic acid test detects the virus's genetic material rather than antibodies."
📑 20. Cite This Tool
StatsUnlock Team. (2026). Nucleic acid calculator: Structure, monomers, molecular weight and concentration [Interactive molecular biology tool]. StatsUnlock. https://statsunlock.com/nucleic-acid-calculator/@misc{statsunlock_nucleic_acid_2026, title={Nucleic Acid Calculator: Structure, Monomers, Molecular Weight and Concentration}, author={{StatsUnlock Team}}, year={2026}, note={Interactive molecular biology tool}, url={https://statsunlock.com/nucleic-acid-calculator/}}Molecular weight, composition, extinction coefficient and concentration of the ___ (___ nt) were calculated with the StatsUnlock Nucleic Acid Calculator (2026): MW ___ g/mol, ___ ng/µL.🔗 21. Related Tools
Every genetics and lab calculator on StatsUnlock in one place.
Open tool →Punnett squares, genotype and phenotype ratios, and a chi-square test.
Open tool →Transcribe DNA to mRNA and translate it codon by codon into protein.
Coming soonWork out a formula from composition, the partner of the element table here.
Open tool →Molar mass of any formula, including single nucleotides.
Open tool →Turn a mass and volume into a molar concentration.
Open tool →C1V1 = C2V2 for primer stocks and working dilutions.
Open tool →Convert a DNA mass to moles with its molecular weight.
Open tool →📖 22. Glossary of Nucleic Acid Terms
| Term | Plain-English meaning |
|---|---|
| A260 | Absorbance at 260 nanometres, used to measure nucleic acid concentration. |
| Antiparallel | Running in opposite directions: one strand 5 prime to 3 prime, the other 3 prime to 5 prime. |
| Base pair (bp) | Two bases paired across a double strand; also the unit of length for double-stranded DNA. |
| Chargaff's rule | In double-stranded DNA the amount of A equals T and G equals C. |
| Complementary strand | The strand whose bases pair with a given strand: A with T or U, G with C. |
| DNA | Deoxyribonucleic acid: the double-stranded nucleic acid that stores genetic information. |
| Deoxyribose | The five-carbon sugar in DNA, with no OH group on carbon 2 prime. |
| Double helix | The twisted ladder shape of DNA: two antiparallel strands wound around each other. |
| Extinction coefficient | How strongly a molecule absorbs light at a wavelength, in per molar per centimetre. |
| GC content | The percentage of bases that are G or C. |
| Hydrogen bond | The weak bond between paired bases: two in A-T and A-U, three in G-C. |
| Hypochromicity | The drop in UV absorbance when bases stack in a strand or pair in a duplex. |
| Melting temperature (Tm) | The temperature at which half of a double strand has separated. |
| Nucleic acid | A polymer of nucleotides that stores or carries genetic information: DNA or RNA. |
| Nucleoside | A sugar joined to a base, with no phosphate. |
| Nucleotide | The monomer of nucleic acids: a phosphate, a five-carbon sugar and a nitrogenous base. |
| Oligonucleotide | A short synthetic nucleic acid, usually 15 to 100 nucleotides. |
| Phosphodiester bond | The covalent link between the 3 prime carbon of one sugar and the 5 prime carbon of the next, through a phosphate. |
| Polynucleotide | A chain of nucleotides; another name for a nucleic acid polymer. |
| Purine | A two-ring base: adenine or guanine. |
| Pyrimidine | A one-ring base: cytosine, thymine or uracil. |
| RNA | Ribonucleic acid: the usually single-stranded nucleic acid that uses genetic information. |
| Reverse complement | The complementary strand written 5 prime to 3 prime. |
| Ribose | The five-carbon sugar in RNA, with an OH group on carbon 2 prime. |
To see how alleles of a gene combine in offspring, try the genotype calculator.
📚 23. References
The nucleic acid structure, the history of its discovery and the formulas for molecular weight, extinction, concentration and melting temperature on this page rest on the peer-reviewed literature below. Every DOI was checked before publication.
- Avery, O. T., MacLeod, C. M., & McCarty, M. (1944). Studies on the chemical nature of the substance inducing transformation of pneumococcal types. Journal of Experimental Medicine, 79(2), 137–158. https://doi.org/10.1084/jem.79.2.137
- Cavaluzzi, M. J., & Borer, P. N. (2004). Revised UV extinction coefficients for nucleoside-5′-monophosphates and unpaired DNA and RNA. Nucleic Acids Research, 32(1), e13. https://doi.org/10.1093/nar/gnh015
- Cech, T. R. (2000). The ribosome is a ribozyme. Science, 289(5481), 878–879. https://doi.org/10.1126/science.289.5481.878
- Chargaff, E. (1950). Chemical specificity of nucleic acids and mechanism of their enzymatic degradation. Experientia, 6, 201–209. https://doi.org/10.1007/BF02173653
- Dahm, R. (2005). Friedrich Miescher and the discovery of DNA. Developmental Biology, 278(2), 274–288. https://doi.org/10.1016/j.ydbio.2004.11.028
- Desjardins, P., & Conklin, D. (2010). NanoDrop microvolume quantitation of nucleic acids. Journal of Visualized Experiments, (45), e2565. https://doi.org/10.3791/2565
- Fire, A., Xu, S., Montgomery, M. K., Kostas, S. A., Driver, S. E., & Mello, C. C. (1998). Potent and specific genetic interference by double-stranded RNA in Caenorhabditis elegans. Nature, 391, 806–811. https://doi.org/10.1038/35888
- Franklin, R. E., & Gosling, R. G. (1953). Molecular configuration in sodium thymonucleate. Nature, 171, 740–741. https://doi.org/10.1038/171740a0
- Hershey, A. D., & Chase, M. (1952). Independent functions of viral protein and nucleic acid in growth of bacteriophage. Journal of General Physiology, 36(1), 39–56. https://doi.org/10.1085/jgp.36.1.39
- International Human Genome Sequencing Consortium. (2001). Initial sequencing and analysis of the human genome. Nature, 409, 860–921. https://doi.org/10.1038/35057062
- Kibbe, W. A. (2007). OligoCalc: An online oligonucleotide properties calculator. Nucleic Acids Research, 35, W43–W46. https://doi.org/10.1093/nar/gkm234
- Kruger, K., Grabowski, P. J., Zaug, A. J., Sands, J., Gottschling, D. E., & Cech, T. R. (1982). Self-splicing RNA: Autoexcision and autocyclization of the ribosomal RNA intervening sequence of Tetrahymena. Cell, 31(1), 147–157. https://doi.org/10.1016/0092-8674(82)90414-7
- Meselson, M., & Stahl, F. W. (1958). The replication of DNA in Escherichia coli. Proceedings of the National Academy of Sciences, 44(7), 671–682. https://doi.org/10.1073/pnas.44.7.671
- Owczarzy, R., You, Y., Moreira, B. G., Manthey, J. A., Huang, L., Behlke, M. A., & Walder, J. A. (2004). Effects of sodium ions on DNA duplex oligomers: Improved predictions of melting temperatures. Biochemistry, 43(12), 3537–3554. https://doi.org/10.1021/bi034621r
- SantaLucia, J., Jr. (1998). A unified view of polymer, dumbbell, and oligonucleotide DNA nearest-neighbor thermodynamics. Proceedings of the National Academy of Sciences, 95(4), 1460–1465. https://doi.org/10.1073/pnas.95.4.1460
- Tataurov, A. V., You, Y., & Owczarzy, R. (2008). Predicting ultraviolet spectrum of single stranded and double stranded deoxyribonucleic acids. Biophysical Chemistry, 133, 66–70. https://doi.org/10.1016/j.bpc.2007.12.004
- Wallace, R. B., Shaffer, J., Murphy, R. F., Bonner, J., Hirose, T., & Itakura, K. (1979). Hybridization of synthetic oligodeoxyribonucleotides to ΦX174 DNA: The effect of single base pair mismatch. Nucleic Acids Research, 6(11), 3543–3557. https://doi.org/10.1093/nar/6.11.3543
- Watson, J. D., & Crick, F. H. C. (1953). Molecular structure of nucleic acids: A structure for deoxyribose nucleic acid. Nature, 171, 737–738. https://doi.org/10.1038/171737a0
- Wilfinger, W. W., Mackey, K., & Chomczynski, P. (1997). Effect of pH and ionic strength on the spectrophotometric assessment of nucleic acid purity. BioTechniques, 22(3), 474–481. https://doi.org/10.2144/97223st01
- Wilkins, M. H. F., Stokes, A. R., & Wilson, H. R. (1953). Molecular structure of deoxypentose nucleic acids. Nature, 171, 738–740. https://doi.org/10.1038/171738a0
