They are both composite materials in basic, but it can be confusing to select which is convenient for the application. Like other material groups such as metals, they have different characteristics and usage areas. Therefore, for the quick answer, it depends on the application and your requirement. We can compare them under some main subjects.

Strength

Carbon fiber stands out in terms of tensile strength. It is just significantly stronger than fiberglass when considered as raw fiber, but when mixed with the appropriate resin, it becomes extremely strong. Moreover, when properly manufactured, carbon fiber can be stronger than many metals. Therefore, everything from aircraft to boats chooses carbon fiber over metal and fiberglass alternatives. The strength of the fiberglass can also be high enough to use in many applications, however, when compared with carbon fiber, it is significantly lower in terms of tensile strength.

Conductivity

Glass fiber can be a good isolator in terms of electrical and thermal properties. It is mostly used in electrical applications to provide dielectric behavior in the systems. Moreover, they are good insulation materials that can be used in deep-sea applications, the construction industry, and more applications to keep thermal balance. With the proper selection of the resin system, glass fiber composite parts can be the best choice for many areas.

Carbon fiber can also be a good thermal isolator, however, it cannot be used in such systems that require electrical insulation when compared to glass fiber. In addition, carbon fiber cannot be used easily in communication applications due to its electromagnetic behavior.

Cost

If composite materials will be used in common applications, cost becomes considerable and must be taken into account. Depending on the mechanical or behavior requirements from the composite part, either carbon fiber or glass fiber can be chosen. In comparison, cost of the carbon fiber becomes significantly higher than glass fiber products. Because of that, carbon fiber commonly used for high strength or safety required applications such as the aerospace industry, space applications. Therefore, the cost of the glass fiber can be affordable if the requirements of the application can be fitted with fiberglass.