How do I calculate density of a string with what I have? The string mass is 12g and length is305.4cm

without knowing the cross sectional area (pi r^2 if round), you can not do it. You want the mass divide by volume for density.

However if it is not really density but mass per unit length you are looking for, for example to find transverse wave speed, it is 12 / 305.4 grams / centimeter or if really doing it seriously in scientific units 0.012/ 3.054 kilograms/meter