Optical code-division multiple-access (OCDMA) systems have recently become a topic of interest as it provides all optical signals processing which is faster in comparison to electrical signal processing. This paper reports the comparative performance analysis of fiber Bragg gratings (FBGs) as encoders for OCDMA system. An attempt has been made to compare two types of FBGs, uniform fiber Bragg grating (UFBG) and super structured fiber Bragg grating (SSFBG) for single user and multiuser OCDMA system. A correlation is derived between output power, quality factor and BER with respect to fiber length and input optical power. Investigations reveal that SSFBG shows better performance as encoder in comparison to UFBG for OCDMA systems in form of all performance metrics that is further proved by the eye diagrams.