The transformer fault diagnosis based on dissolved gas analysis is greatly affected by the uncertainties existing in measured data during oil sampling, handling and storage. This work aims to develop an efficient code matrix based on dissolved gas percentages for accurate fault diagnosis considering measurement uncertainties. Fuzzy system is utilized to produce the rules that map the limits of gas ratios for different fault types. Each gas percentage range is divided into three regions represented by three fuzzy memberships. The fuzzy system is then developed to relate the gas percentages to the fault type. The membership limits are then optimized by using heuristic algorithms in order to maximize the accuracy. Hybrid Grey Wolf Optimization (HGWO) algorithm is utilized to produce the diagnostic code matrix. The proposed code limits the impact of measurement uncertainties on the output fault diagnosis. Different levels of measurement uncertainties up to 20% are considered to validate the effectiveness of the new code in improving the diagnostic accuracy. The accuracies during the training and testing processes attained 97.45% and 95.45%, respectively, with the maximum uncertainty level of 20%. Moreover, randomly selected case studies representing various fault types are investigated using the proposed method. For each case study, various levels of uncertainties are imposed on the original data. The proposed method proved its easiness towards diagnosing transformer faults and robustness against measurement uncertainties.