The helicity is a topological conserved quantity of the Euler equations which imposes significant constraints on the dynamics of vortex lines. In the compressible setting, the conservation law holds only under the assumption that the pressure is barotropic. Let us consider a volume
$V$ containing a compressible fluid with density
$\rho$, velocity field
$\textbf{u}$ and vorticity
$\boldsymbol{\omega}$. We show that by introducing a new definition of helicity density
$h_{\rho }=(\rho {\boldsymbol {u}})\cdot \mbox {curl}\,(\rho {\boldsymbol {u}})$ the barotropic assumption on the pressure can be removed, although
${\int _{V}} h_{\rho }{\rm d}V$ is no longer conserved. However, we show for the non-barotropic compressible Euler equations that the new helicity density
$h_{\rho }$ obeys an entropy-type relation (in the sense of hyperbolic conservation laws) whose flux
${\boldsymbol {J}}_{\rho }$ contains all the pressure terms and whose source involves the potential vorticity
$q = \boldsymbol{\omega} \cdot \nabla \rho$. Therefore, the rate of change of
${\int _{V}} h_{\rho }{\rm d}V$ no longer depends on the pressure and is easier to analyse, as it depends only on the potential vorticity and kinetic energy as well as
$\mbox {div}\,{\boldsymbol {u}}$. This result also carries over to the inhomogeneous incompressible Euler equations for which the potential vorticity
$q$ is a material constant. Therefore,
$q$ is bounded by its initial value
$q_{0}=q({\boldsymbol {x}},\,0)$, which enables us to define an inverse resolution length scale
$\lambda _{H}^{-1}$ whose upper bound is found to be proportional to
$\|q_{0}\|_{\infty }^{2/7}$. In a similar manner, we also introduce a new cross-helicity density for the ideal non-barotropic magnetohydrodynamic (MHD) equations.