Let Q be an alphabet with q elements. For any code C over Q of length n and for any two codewords a = (a 1, . . . , a n ) and b = (b 1, . . . , b n ) in C, let $${D({\bf a, b}) = \{(x_1, . . . , x_n) \in {Q^n} : {x_i} \in \{a_i, b_i\}\,{\rm for}\,1 \leq i \leq n\}}$$ . Let $${C^* = {{\bigcup}_{\rm {a,\,b}\in{C}}}D({\bf a, b})}$$ . The code C is said to have the identifiable parent property (IPP) if, for any $${{\rm {\bf x}} \in C^*}$$ , $${{\bigcap}_{{\rm x}{\in}D({\rm a,\,b})}\{{\bf a, b}\}\neq \emptyset} $$ . Codes with the IPP were introduced by Hollmann et al [J. Combin. Theory Ser. A 82 (1998) 21–133]. Let F(n, q) = max{|C|: C is a q-ary code of length n with the IPP}.Tô and Safavi-Naini [SIAM J. Discrete Math. 17 (2004) 548–570] showed that $${3q + 6 - 6 \lceil\sqrt{q+1}\rceil \leq F(3, q) \leq 3q + 6 - \lceil 6 \sqrt{q+1}\rceil}$$ , and determined F (3, q) precisely when q ≤ 48 or when q can be expressed as r 2 + 2r or r 2 + 3r +2 for r ≥ 2. In this paper, we establish a precise formula of F(3, q) for q ≥ 24. Moreover, we construct IPP codes of size F(3, q) for q ≥ 24 and show that, for any such code C and any $${{\rm {\bf x}} \in C^*}$$ , one can find, in constant time, $${{\rm {\bf a}} \in C}$$ such that if $${{\rm {\bf x}} \in D ({\bf c, d})}$$ then $${{\rm {\bf a}} \in \{{\rm {\bf c, d}}\}}$$ .